[KVA]K Stochastic IndicatorOriginal Stochastic Oscillator Formula:
%K=(C−Lowest Low)/(Highest High−Lowest Low)×100
    Lowest Low refers to the lowest low of the past n periods.
    Highest High refers to the highest high of the past n periods.
 K Stochastic Indicator Formula:
%K=(Source−Lowest Source)/(Highest Source−Lowest Source)×100
    Lowest Source refers to the lowest value of the chosen source over the past length periods.
    Highest Source refers to the highest value of the chosen source over the past length periods.
 Key Difference :
    The original formula calculates %K using the absolute highest high and lowest low of the price over the past n periods.
    The  K Stochastic formula calculates %K using the highest and lowest values of a chosen source (which could be the close, open, high, or low) over the specified length periods.
So, if _src is set to something other than the high for the Highest Source or something other than the low for the Lowest Source, the  K Stochastic will yield different results compared to the original formula which strictly uses the highest high and the lowest low of the price. 
 Impact on Traders :
     Flexibility in Price Source :
        By allowing the source (_src) to be customizable, traders can apply the Stochastic calculation to different price points (e.g., open, high, low, close, or even an average of these). This could provide a different perspective on market momentum and potentially offer signals that are more aligned with a trader's specific strategy.
     Sensitivity to Price Action :
        Changing the source from high/low to potentially less extreme values (like close or open) could result in a less volatile oscillator, smoothing out some of the extreme peaks and troughs and possibly offering a more filtered view of market conditions.
     Customization of Periods :
        The ability to adjust the length period offers traders the opportunity to fine-tune the sensitivity of the indicator to match their trading horizon. Shorter periods may provide earlier signals, while longer periods could filter out market noise.
 Possibility of Applying the Indicator on Other Indicators :
     Layered Technical Analysis :
        The  K Stochastic can be applied to other indicators, not just price. For example, it could be applied to a moving average to analyze its momentum or to indicators like RSI or MACD, offering a meta-analysis that studies the oscillator's behavior of other technical tools.
     Creation of Composite Indicator s:
        By applying the  K Stochastic logic to other indicators, traders could create composite indicators that blend the characteristics of multiple indicators, potentially leading to unique signals that could offer an edge in certain market conditions.
     Enhanced Signal Interpretation :
        When applied to other indicators, the  K Stochastic can help in identifying overbought or oversold conditions within those indicators, offering a different dimension to the interpretation of their output.
 Overall Implications :
    The KStochastic Indicator's modifications could lead to a more tailored application, giving traders the ability to adapt the tool to their specific trading style and analysis preferences.
    By being applicable to other indicators, it broadens the scope of stochastic analysis beyond price action, potentially offering innovative ways to interpret data and make trading decisions.
    The changes might also influence the trading signals, either by smoothing the oscillator's output to reduce noise or by altering the sensitivity to generate more or fewer signal 
Including the additional %F line, which is unique to the  K Stochastic Indicator, further expands the potential impacts and applications for traders:
Impact on Traders with the %F Line:
     Triple Smoothing :
        The %F line introduces a third level of smoothing, which could help in identifying longer-term trends and filtering out short-term fluctuations. This could be particularly useful for traders looking to avoid whipsaws and focus on more sustained movements.
     Potential for Enhanced Confirmation :
        The %F line might be used as a confirmation signal. For instance, if all three lines (%K, %D, and %F) are in agreement, a trader might consider this as a stronger signal to buy or sell, as opposed to when only the traditional two lines (%K and %D) are used.
    Risk Management:
        The additional line could be utilized for more sophisticated risk management strategies, where a trader might decide to scale in or out of positions based on the convergence or divergence of these lines.
Possibility of Applying the Indicator on Other Indicators with the %F Line:
     Depth of Analysis :
        When applied to other indicators, the %F line can provide an even deeper layer of analysis, perhaps identifying macro trends within the indicator it is applied to, which could go unnoticed with just the traditional two-line approach.
     Refined Signal Strength Assessment :
        The strength of signals from other indicators could be assessed by the position and direction of the %F line, providing an additional filter to evaluate the robustness of buy or sell signals.
 Overall Implications with the %F Line :
    The inclusion of the %F line in the  K Stochastic Indicator enhances its utility as a tool for trend analysis and signal confirmation. It allows traders to potentially identify and act on more reliable trading opportunities.
    This feature can enrich the trader's toolkit by providing a nuanced view of momentum and trend strength, which can be particularly valuable in volatile or choppy markets.
    For those applying the  K Stochastic to other indicators, the %F line could be integral in creating a multi-tiered analysis strategy, potentially leading to more sophisticated interpretations and decisions.
The presence of the %F line adds a dimension of depth to the analysis possible with the  K Stochastic Indicator, making it a versatile tool that could be tailored to a variety of trading styles and objectives. However, as with any indicator, the additional complexity requires careful study and back-testing to ensure its signals are understood and actionable within the context of a comprehensive trading plan.
In den Scripts nach "high low" suchen
libHTF[without request.security()]Library   "libHTF" 
libHTF: use HTF values without request.security()
This library enables to use HTF candles without request.security().
 Basic data structure 
Using  to access values in the same manner as series variable.
The last member of HTF array is always latest current TF's data.
If new bar in HTF(same as last bar closes), new member is pushed to HTF array.
2nd from the last member of HTF array is latest fixed(closed) bar.
 HTF: How to use 
 1. set TF 
tf_higher() function selects higher TF. TF steps are ("1","5","15","60","240","D","W","M","3M","6M","Y").
example:
 tfChart = timeframe.period
htf1 = tf_higher(tfChart) 
 2. set HTF matrix 
htf_candle() function returns 1 bool and 1 matrix.
bool is a flag for start of new candle in HTF context.
matrix is HTF candle data(0:open,1:time_open,2:close,3:time_close,4:high,5:time:high,6:low,7:time_low).
example:
 =htf_candle(htf1) 
 3. how to access HTF candle data 
you can get values using .lastx() method.
please be careful, return value is always float evenif it is "time". you need to cast to int time value when using for xloc.bartime.
example:
 htf1open=m1.lastx("open")
htf1close=m1.lastx("close")
//if you need to use histrical value.
lastopen=open 
lasthtf1open=m1.lastx("open",1) 
 4. how to store Data of HTF context 
you have to use array to store data of HTF context.
array.htf_push() method handles the last member of array. if new_bar in HTF, it push new member. otherwise it set value to the last member.
example:
 array a_close=array.new(1,na)
a_close.htf_push(b_new_bar1,m1.lastx("close")) 
 HTFsrc: How to use 
 1. how to setup src. 
set_src() function is set current tf's src from string(open/high/low/close/hl2/hlc3/ohlc4/hlcc4).
set_htfsrc() function returns src array of HTF candle.
example:
 _src="ohlc4"
src=set_src(_src)
htf1src=set_htfsrc(_src,b_new_bar1,m1)
(if you need to use HTF src in series float)
s_htf1src=htf1src.lastx() 
 HighLow: How to use 
 1. set HTF arrays 
highlow() and htfhighlow() function calculates high/low and return high/low prices and time.
the functions return 1 int and 8arrays.
int is a flag for new high(1) or new low(-1).
arrays are high/low and return high/low data. float for price, int for time.
example
  =
highlow()
  =
htfhighlow(m1) 
 2. how to access HighLow data 
you can get values using .lastx() method.
example:
 if i_renew==1
myhigh=a_high.lastx()
//if you need to use histrical value.
myhigh=a_high.lastx(1)
 
 other functions 
functions for HTF candle matrix or HTF src array in this script are
htf_sma()/htf_ema()/htf_rma()
htf_rsi()/htf_rci()/htf_dmi()
 method lastx(arrayid, lastindex) 
  method like array.last. it returns lastindex from the last member, if parameter is set.
  Namespace types: float 
  Parameters:
     arrayid (float ) 
     lastindex (int) : (int) default value is "0"(the last member). if you need to access historical value, increment it(same manner as series vars).
  Returns: float value of lastindex from the last member of the array. returns na, if fail.
 method lastx(arrayid, lastindex) 
  method like array.last. it returns lastindex from the last member, if parameter is set.
  Namespace types: int 
  Parameters:
     arrayid (int ) 
     lastindex (int) : (int) default value is "0"(the last member). if you need to access historical value, increment it(same manner as series vars).
  Returns: int value of lastindex from the last member of the array. returns na, if fail.
 method lastx(m, _type, lastindex) 
  method for handling htf matrix.
  Namespace types: matrix
  Parameters:
     m (matrix) : (matrix) matrix for htf candle.
     _type (string) : (string) value type of htf candle: 
     lastindex (int) : (int) default value is "0"(the last member).
  Returns: (float) value of htf candle. (caution: need to cast float to int to use time values!)
 method set_last(arrayid, val) 
  method to set a value of the last member of the array. it sets value to the last member.
  Namespace types: float 
  Parameters:
     arrayid (float ) 
     val (float) : (float) value to set.
  Returns: nothing
 method htf_push(arrayid, b, val) 
  method to push new member to htf context. if new bar in htf, it works as push. else it works as set_last.
  Namespace types: float 
  Parameters:
     arrayid (float ) 
     b (bool) : (bool) true:push,false:set_last
     val (float) : (float) _f the value to set.
  Returns: nothing
 method tf_higher(tf) 
  method to set higher tf from tf string. TF steps are  .
  Namespace types: series string, simple string, input string, const string
  Parameters:
     tf (string) : (string) tf string
  Returns: (string) string of higher tf.
 htf_candle(_tf, _TZ) 
  build htf candles
  Parameters:
     _tf (string) : (string) tf string.
     _TZ (string) :   of timezone. default value is "GMT+3".
  Returns:   bool for new bar@htf and matrix for snapshot of htf candle
 set_src(_src_type) 
  set src.
  Parameters:
     _src_type (string) : (string) type of source: 
  Returns: (series float) src value
 set_htfsrc(_src_type, _nb, _m) 
  set htf src.
  Parameters:
     _src_type (string) : (string) type of source: 
     _nb (bool) : (bool) flag of new bar
     _m (matrix) : (matrix) matrix for htf candle.
  Returns: (array) array of src value
 is_up() 
 last_is_up() 
 peak_bottom(_latest, _last) 
  Parameters:
     _latest (bool) 
     _last (bool) 
 htf_is_up(_m) 
  Parameters:
     _m (matrix) 
 htf_last_is_up(_m) 
  Parameters:
     _m (matrix) 
 highlow(_b_bartime_price) 
  Parameters:
     _b_bartime_price (bool) 
 htfhighlow(_m, _b_bartime_price) 
  Parameters:
     _m (matrix) 
     _b_bartime_price (bool) 
 htf_sma(_a_src, _len) 
  Parameters:
     _a_src (float ) 
     _len (int) 
 htf_rma(_a_src, _new_bar, _len) 
  Parameters:
     _a_src (float ) 
     _new_bar (bool) 
     _len (int) 
 htf_ema(_a_src, _new_bar, _len) 
  Parameters:
     _a_src (float ) 
     _new_bar (bool) 
     _len (int) 
 htf_rsi(_a_src, _new_bar, _len) 
  Parameters:
     _a_src (float ) 
     _new_bar (bool) 
     _len (int) 
 rci(_src, _len) 
  Parameters:
     _src (float) 
     _len (int) 
 htf_rci(_a_src, _len) 
  Parameters:
     _a_src (float ) 
     _len (int) 
 htf_dmi(_m, _new_bar, _len, _ma_type) 
  Parameters:
     _m (matrix) 
     _new_bar (bool) 
     _len (int) 
     _ma_type (string)
4H RangeThis script visualizes certain key values based on a 4-hour timeframe of the selected market on the chart. These values include the High, Mid, and Low price levels during each 4-hour period.
These levels can be helpful to identify inside range price action, chop, and consolidation. They can sometimes act as pivots and can be a great reference for potential entries and exits if price continues to hold the same range. 
Here's a step-by-step overview of what this indicator does:
1. Inputs: At the beginning of the script, users are allowed to customize some inputs:
    Choose the color of lines and labels.
    Decide whether to show labels on the chart.
    Choose the size of labels ("tiny", "small", "normal", or "large").
    Choose whether to display price values in labels.
    Set the number of bars to offset the labels to the right.
    Set a threshold for the number of ticks that triggers a new calculation of high, mid, and low values.
    * Tick settings may need to be increased on equity charts as one tick is usually equal to one cent. 
       For example, if you want to clear the range when there is a close one point/one dollar above or below the range high/low then on ES
       that would be 4 ticks but one whole point on AAPL would be 100 ticks. 100 ticks on an equity chart may or may not be ideal due to 
       different % change of 100 ticks might be too excessive depending on the price per share. 
       So be aware that user preferred thresholds can vary greatly depending on which chart you're using. 
2. Retrieving Price Data: The script retrieves the high, low, and closing price for every 4-hour period for the current market. 
    The script also calculates the mid-price of each 4-hour period (the average of the high and low prices).
3. Line Drawing: At the start of the script (first run), it draws three lines (high, mid, and low) at the levels corresponding to the high, 
    mid, and low prices. Users can also change transparency settings on historical lines to view them. Default setting for historical lines 
    is for them to be hidden. 
4. Updating Lines and Labels: For each subsequent 4-hour period, the script checks whether the close price of the period has gone 
    beyond a certain threshold (set by user input) above the previous high or below the previous low. If it has, the script deletes the 
    previous lines and labels, draws new lines at the new high, mid, and low levels, and creates new labels (if the user has opted to 
    show labels).
5. Displaying Values in the Data Window: In addition to the visual representation on the chart, the script also plots the high, mid, and 
    low prices. These plotted values appear in the Data Window of TradingView, allowing users to see the exact price levels even when
    they're not directly labeled on the chart.
6. Updating Lines and Labels Position: At the end of each period, the script moves the lines and labels (if they're shown) to the right, 
    keeping them aligned with the current period.
Please note: This script operates based on a 4-hour timeframe, regardless of the timeframe selected on the chart. If a shorter timeframe is selected on the chart, the lines and labels will appear to extend across multiple bars because they represent 4-hour price levels. If a longer timeframe is selected, the lines and labels may not accurately represent high, mid, and low levels within that longer timeframe.
DB Support Resistance Levels + Smart Higher Highs and Lower LowsDB Support Resistance Levels  + Smart Higher Highs and Lower Lows
The indicator plots historic lines for high, low and close prices shown in settings as "base levels". Users can control the lookback period that is plotted along with an optional multiplier. Traders will notice that the price bounces off these historic base levels. The base levels are shown as light gray by default (customizable in the settings). Users may choose to display base levels by a combination of historic high, low and close values. 
On top of the historic base levels, the indicator display higher high and lower low levels from the current bar high/low. Higher highs are shown by default in pink and lower lows by default in yellow. The user can adjust the lookback period for displaying higher highs and the optional multiplier. Only historic values higher than the current bar high are displayed filtering out (by highlighting) the remaining levels for the current bar.  Users may choose to use a combination of historic open, low and close values for displaying higher highs. The user can adjust the lookback period for displaying lower lows and the optional multiplier. Only historic values lower than the current bar low are displayed filtering out (by highlighting) the remaining levels for the current bar.  Users may choose to use a combination of historic open, low and close values for displaying lower low.
The indicator includes two optional filters for filtering out higher highs and lower lows to focus (highlight) the most relevant levels. The filters include KC and a simple price multiplier filter. The latter is enabled by default and recommended. 
The indicator aims to provide two things; first a simple plot of historic base levels and second as the price moves to highlight the most relevant levels for the current price action. While the indicator works on all timeframes, it was tested with the weekly. Please keep in mind adjusting the timeframe may require the lookback settings to be adjusted to ensure the bars are within range.
 How should I use this indicator? 
Traders may use this indicator to gain a visual reference of support and resistance levels from higher periods of time with the most likely levels highlighted in pink and yellow.  Replaying the indicator gives a visual show of levels in action and just how very often price action bounces from these highlighted levels.
 Additional Notes 
This indicator does increase the max total lines allowed which may impact performance depending on device specs. No alerts or signals for now. Perhaps coming soon...
The Strat [LuxAlgo]The Strat indicator is a full toolkit regarding most of the concepts within "The Strat" methodology with features such as candle numbering, pivot machine gun (PMG) highlighting, custom combo highlighting, and various statistics included.
Alerts are also included for the detection of specific candle numbers, custom combos, and PMGs.
🔶  SETTINGS 
 
 Show Numbers on Chart: Shows candle numbering on the chart.
 Style Candles: Style candles based on the detected number. Only effective on non-line charts and if the script is brought to the front.
 
🔹  Custom Combo Search 
 
 Combo: User defined combo to be searched by the script. Combos can be composed of any series of numbers including (1, 2, -2, 3), e.g : 2-21. No spaces or other characters should be used.
 
🔹  Pivot Machine Gun 
 
 Show Labels: Highlight detected PMGs with a label.
 Min Sequence Length: Minimum sequence length of consecutive higher lows/lower highs required to detect a PMG.
 Min Breaks: Minimum amount of broken previous highs/lows required to detect a PMG.
 Show Levels: Show levels of the broken highs/lows.
 
🔹  Pivot Combos 
 
 Pivot Lookback: Lookback period used for detecting pivot points.
 Right Bars Scan: Number of bars scanned to the right side of a detected pivot.
 Left Bars Scan: Number of bars scanned to the left side of a detected pivot.
 
🔹  Dashboard 
 
 Show Dashboard: Displays statistics dashboard on chart.
 Numbers Counter: Displays the numbers counter section on the dashboard.
 Pivot Combos: Displays pivots combo section on the dashboard.
 %: Display the percentage of detected pivot combos on the dashboard instead of absolute numbers. 
 Pivot Combos Rows: Number of rows displayed by the "Pivots Combo" dashboard section.
 Show MTF: Showa MTF candle numbering on the dashboard.
 Location: Location of the dashboard on the chart.
 Size: Size of the displayed dashboard.
 
🔶  USAGE 
  
This script allows users with an understanding of The Strat to quickly highlight elements such as candle numbers, pivot machine guns, and custom combos. The usage for these concepts is given in the sub-sections below.
🔹  Candle Numbers 
  
The Strat assigns a number to individual candles, this number is determined by the current candle position relative to the precedent candle, these include:
 
 Number 1 - Inside bar, occurs when the previous candle range engulfs the current one.
 Number 2 Up - Upside Directional Bar, occurs when the current price high breaks the previous high while the current low is lower than the previous high.
 Number 2 Down - Downside Directional Bar, occurs when the current price low breaks the previous low while the current high is higher than the previous low.
 Number 3 - Outside bar, occurs when the current candle range engulfs the previous one.
The script can highlight the number of a candle by using labels but can also style candles by depending on the candle number. Inside bars (1) only have their candle wick highlighted, directional bars (2) (-2) only have their candle body highlighted. Outside bars have their candle range highlighted.
Note that downside directional bars are highlighted with the number -2.
Users can see the total amount of times a specific candle number is detected on the historical data on the dashboard available within the settings, as well as the number of times a candle number is detected relative to the total amount of detected candle numbers expressed as a percentage.
It is also possible to see the current candle numbers returned by multiple timeframes on the dashboard.
🔹  Searching For Custom Combos 
  
Combos are made of a sequence of two or more candle numbers. These combos can highlight multiple reversals/continuation scenarios. Various common combos are documented by The Strat community.
This script allows users to search for custom combos by entering them on the  Combo  user setting field.
When a user combo is found, it is highlighted on the chart as a box highlighting the combo range.
🔹  Pivot Combos 
  
It can be of interest to a user to display the combo associated with a pivot high/low. This script will highlight the location of pivot points on the chart and display its associated combo by default. These are based on the Pivot Combo lookback and not displayed in real-time.
Users can see on the dashboard the combos associated with a pivot high/low, these are ranked by frequency.
🔹  Pivot Machine Gun (PMG) 
  
Pivot Machine Guns (PMG)s describe the scenario where a single price variation breaks the value of multiple past successive higher lows/lower highs. This can highlight a self-exciting behavior, where even more past successive higher lows/lower highs get broken.
Users can select the minimum sequence length of successive higher lows/lower highs required for a PMG to be detected, as well the amount of these successive higher lows/lower highs that must be broken.
Opening Range & Daily and Weekly PivotsThis script is for a combination of two indicators: an Opening Range Breakout (ORB) indicator and a daily/weekly high/low pivot indicator. The ORB indicator displays the opening range (the high and low of the first X minutes of the trading day, where X is a user-defined parameter) as two lines on the chart. If the price closes above the ORB high, the script triggers an alert with the message "Price has broken above the opening range." Similarly, if the price closes below the ORB low, the script triggers an alert with the message "Price has broken below the opening range."
The daily/weekly high/low pivot indicator plots the previous day's high and low as well as the previous week's high and low. If the current price closes above yesterday's high or last week's high, the script triggers an alert with the messages "We are now trading higher than the previous daily high" and "We are now trading higher than the last week high", respectively. If the current price closes below yesterday's low or last week's low, the script triggers an alert with the messages "We are now trading lower than the previous daily low" and "We are now trading lower than the last week low", respectively.
In addition to the visual representation on the chart, the script also triggers alerts when the price crosses any of these levels. These alerts are intended to help traders make decisions about entering or exiting trades based on the price action relative to key levels of support and resistance.
ATR PivotsThe "ATR Pivots" script is a technical analysis tool designed to help traders identify key levels of support and resistance on a chart. The indicator uses various metrics such as the Average True Range (ATR), Daily True Range ( DTR ), Daily True Range Percentage (DTR%), Average Daily Range (ADR), Previous Day High ( PDH ), and Previous Day Low ( PDL ) to provide a comprehensive picture of the volatility and movement of a security. The script also includes an EMA cloud and 200 EMA for trend identification and a 1-minute ATR scalping strategy for traders to make informed trading decisions.
ATR Detail:-
The ATR is a measure of the volatility of a security over a given period of time. It is calculated by taking the average of the true range (the difference between the high and low of a security) over a set number of periods. The user can input the number of periods (ATR length) to be used for the ATR calculation. The script also allows the user to choose whether to use the current close or not for the calculation. The script calculates various levels of support and resistance based on the relationship between the security's range ( high-low ) and the ATR. The levels are calculated by multiplying the ATR by different Fibonacci ratios (0.236, 0.382, 0.5, 0.618, 0.786, 1.000) and then adding or subtracting the result from the previous close. The script plots these levels on the chart, with the -100 level being the most significant level. The user also has an option to choose whether to plot all Fibonacci levels or not.
DTR and DTR% Detail:-
The Daily True Range Percentage (DTR%) is a metric that measures the daily volatility of a security as a percentage of its previous close. It is calculated by dividing the Daily True Range ( DTR ) by the previous close. DTR is the range between the current period's high and low and gives a measure of the volatility of the security on a daily basis. DTR% can be used as an indicator of the percentage of movement of the security on a daily basis. In this script, DTR% is used in combination with other metrics such as the Average True Range (ATR) and Fibonacci ratios to calculate key levels of support and resistance for the security. The idea behind using DTR% is that it can help traders to better understand the daily volatility of the security and make more informed trading decisions.
For example, if a security has a DTR% of 2%, it suggests that the security has a relatively low level of volatility and is less likely to experience significant price movements on a daily basis. On the other hand, if a security has a DTR% of 10%, it suggests that the security has a relatively high level of volatility and is more likely to experience significant price movements on a daily basis.
ADR:-
The script then calculates the ADR (Average Daily Range) which is the average of the daily range of the security, using the formula (Period High - Period Low) / ATR Length. This gives a measure of the average volatility of the security on a daily basis, which can be useful for determining potential levels of support and resistance .
PDH /PDL:-
The script also calculates PDH (Previous Day High) and PDL (Previous Day Low) which are the High and low of the previous day of the security. This gives a measure of the previous day's volatility and movement, which can be useful for determining potential levels of support and resistance .
EMA Cloud and 200 EMA Detail:-
The EMA cloud is a technical analysis tool that helps traders identify the trend of the market by comparing two different exponential moving averages (EMAs) of different lengths. The cloud is created by plotting the fast EMA and the slow EMA on the chart and filling the space between them. The user can input the length of the fast and slow EMA , and the script will calculate and plot these EMAs on the chart. The space between the two EMAs is then filled with a color that represents the trend, with green indicating a bullish trend and red indicating a bearish trend . Additionally, the script also plots a 200 EMA , which is a commonly used long-term trend indicator. When the fast EMA is above the slow EMA and the 200 EMA , it is considered a bullish signal, indicating an uptrend. When the fast EMA is below the slow EMA and the 200 EMA , it is considered a bearish signal, indicating a downtrend. The EMA cloud and 200 EMA can be used together to help traders identify the overall trend of the market and make more informed trading decisions.
1 Minute ATR Scalping Strategy:-
The script also includes a 1-minute ATR scalping strategy that can be used by traders looking for quick profits in the market. The strategy involves using the ATR levels calculated by the script as well as the EMA cloud and 200 EMA to identify potential buy and sell opportunities. For example, if the 1-minute ATR is above 11 in NIFTY and the EMA cloud is bullish , the strategy suggests buying the security. Similarly, if the 1-minute ATR is above 30 in BANKNIFTY and the EMA cloud is bullish , the strategy suggests buying the security.
Inside Candle:-
The Inside Candle is a price action pattern that occurs when the current candle's high and low are entirely within the range of the previous candle's high and low. This pattern indicates indecision or consolidation in the market and can be a potential sign of a trend reversal. When used in the 15-minute chart, traders can look for Inside Candle patterns that occur at key levels of support or resistance. If the Inside Candle pattern occurs at a key level and the price subsequently breaks out of the range of the Inside Candle, it can be a signal to enter a trade in the direction of the breakout. Traders can also use the Inside Candle pattern to trade in a tight range, or to reduce their exposure to a current trend.
Risk Management:-
As with any trading strategy, it is important to practice proper risk management when using the ATR Pivots script and the 1-minute ATR scalping strategy. This may include setting stop-loss orders, using appropriate position sizing, and diversifying your portfolio. It is also important to note that past performance is not indicative of future results and that the script and strategy provided are for educational purposes only.
In conclusion, the "ATR Pivots" script is a powerful tool that can help traders identify key levels of support and resistance , as well as trend direction. The additional metrics such as DTR , DTR%, ADR, PDH , and PDL provide a more comprehensive picture of the volatility and movement of the security, making it easier for traders to make better trading decisions. The inclusion of the EMA cloud and 200 EMA for trend identification, and the 1-minute ATR scalping strategy for quick profits can further enhance a trader's decision-making process. However, it is important to practice proper risk management and understand that past performance is not indicative of future results.
Special thanks to satymahajan for the idea of clubbing Average True Range with Fibonacci levels.
Session candles & reversals / quantifytools— Overview 
Like traditional candles, session based candles are a visualization of open, high, low and close values, but based on session time periods instead of typical timeframes such as daily or weekly. Session candles are formed by fetching price at session start (open), highest price during session (high), lowest price during session (low) and price at session end (close). On top of candles, session based moving average is formed and session reversals detected. Session reversals are also backtested, using win rate and magnitude metrics to better understand what to expect from session reversals and which ones have historically performed the best. 
By default, following session time periods are used:
Session #1: London (08:00 - 17:00, UTC)
Session #2: New York (13:00 - 22:00, UTC)
Session #3: Sydney (21:00 - 06:00, UTC)
Session #4: Tokyo (00:00 - 09:00, UTC)
Session time periods can be changed via input menu.
 — Reversals 
Session reversals are patterns that show a rapid change in direction during session. These formations are more familiarly known as wicks or engulfing candles. Following criteria must be met to qualify as a session reversal:
Wick up:
Lower high, lower low, close >= 65% of session range (0% being the very low, 100% being the very high) and open >= 40% of session range.
Wick down:
Higher high, higher low, close <= 35% of session range and open <= 60% of session range.
Engulfing up:
Higher high, lower low, close >= 65% of session range.
Engulfing down:
Higher high, lower low, close <= 35% of session range.
Session reversals are always based on  prior corresponding session , e.g. to qualify as a NY session engulfing up, NY session must have a higher high and lower low  relative to prior NY session , not just any session that has taken place in between. Session reversals should be viewed the same way wicks/engulfing formations are viewed on traditional timeframe based candles. Essentially, wick reversals (light green/red labels) tell you most of the motion during session was reversed. Engulfing reversals (dark green/red labels) on the other hand tell you all of the motion was reversed and new direction set.
 — Backtesting 
Session reversals are backtested using win rate and magnitude metrics. A session reversal is considered successful when  next corresponding session  closes higher/lower than  session reversal close . Win rate is formed by dividing successful session reversal count with total reversal count, e.g. 5 successful reversals up / 10 reversals up total = 50% win rate. Win rate tells us what are the odds (historically) of session reversal producing a clean supporting move that was persistent enough to close that way too.
When a session reversal is successful, its magnitude is measured using percentage increase/decrease  from session reversal close   to  next corresponding session high/low . If NY session closes higher than prior NY session that was a reversal up, the percentage increase from prior session close (reversal close) to current session high is measured. If NY session closes lower than prior NY session that was a reversal down, the percentage decrease from prior session close to current session low is measured.
Average magnitude is formed by dividing all percentage increases/decreases with total reversal count, e.g. 10 total reversals up with 1% increase each -> 10% net increase from all reversals -> 10% total increase / 10 total reversals up = 1% average magnitude. Magnitude metric supports win rate by indicating the depth of successful session reversal moves. 
To better understand the backtesting calculations and more importantly to verify their validity, backtesting visuals for each session can be plotted on the chart:
  
All backtesting results are shown in the backtesting panel on top right corner, with highest win rates and magnitude metrics for both reversals up and down marked separately. Note that past performance is not a guarantee of future performance and session reversals as they are should not be viewed as a complete strategy for long/short plays.  Always make sure reversal count is sufficient to draw reliable conclusions of performance. 
 — Session moving average 
Users can form a session based moving average with their preferred smoothing method (SMA , EMA , HMA , WMA , RMA) and length, as well as choose which sessions to include in the moving average. For example, a moving average based on New York and Tokyo sessions can be formed, leaving London and Sydney completely out of the calculation. 
 — Visuals 
By default, script hides your candles/bars, although in the case of candles borders will still be visible. Switching to bars/line will make your regular chart visuals 100% hidden. This setting can be turned off via input menu. As some sessions overlap, each session candle can be separately offsetted forward, clearing the overlaps. Users can also choose which session candles to show/hide. 
Session periods can be highlighted on the chart as a background color, applicable to only session candles that are activated. By default, session reversals are referred to as L (London), N (New York), S (Sydney) and T (Tokyo) in both reversal labels and backtesting table. By toggling on "Numerize sessions", these will be replaced with 1, 2, 3 and 4. This will be helpful when using a custom session that isn't any of the above.
 Visual settings example: 
  
Session candles are plotted in two formats, using boxes and lines as well as plotcandle() function. Session candles constructed using boxes and lines will be clear and much easier on the eyes, but will apply only to first 500 bars due to Tradingview related limitations. Rest of the session candles go back indefinitely, but won't be as clean:
  
All colors can be customized via input menu.
 — Timeframe & session time period considerations 
As a rule of thumb, session candles should be used on timeframes at or below 1H, as higher timeframes might not match with session period start/end, leading to incorrect plots. Using 1 hour timeframe will bring optimal results as greatest amount historical data is available without sacrificing accuracy of OHLC values. If you are using a custom session that is not based on hourly period (e.g. 08:00 - 15:00 vs. 08.00 - 15.15) make sure you are using a timeframe that allows correct plots.
Session time periods applied by default are rough estimates and might be out of bounds on some charts, like NYSE listed equities. This is rarely a problem on assets that have extensive trading hours, like futures or cryptocurrency. If a session is out of bounds (asset isn't traded during the set session time period) the script won't plot given session candle and its backtesting metrics will be NA. This can be fixed by changing the session time periods to match with given asset trading hours, although you will have to consider whether or not this defeats the purpose of having candles based on sessions. 
 — Practical guide 
Whether based on traditional timeframes or sessions, reversals should always be considered as only one piece of evidence of price turning. Never react to them without considering other factors that might support the thesis, such as levels and multi-timeframe analysis. In short, same basic charting principles apply with session candles that apply with normal candles. Use discretion.
 Example #1 : Focusing efforts on session reversals at distinct support/resistance levels
A reversal against a level holds more value than a reversal by itself, as you know it's a placement where liquidity can be expected. A reversal serves as a confirming reaction for this expectation.
  
 Example #2 : Focusing efforts on highest performing reversals and avoiding poorly performing ones
As you have data backed evidence of session reversal performance, it makes sense to focus your efforts on the ones that perform best. If some session reversal is clearly performing poorly, you would want to avoid it, since there's nothing backing up its validity.
  
 Example #3 : Reversal clusters
Two is better than one, three is better than two and so on. If there are rapid changes in direction within multiple sessions consecutively, there's heavier evidence of a dynamic shift in price. In such case, it makes sense to hold more confidence in price halting/turning.
  
SUPERTREND MIXED ICHI-DMI-DONCHIAN-VOL-GAP-HLBox@RLSUPERTREND MIXED ICHI-DMI-VOL-GAP-HLBox@RL 
by RegisL76
This script is based on several trend indicators. 
* ICHIMOKU (KINKO HYO) 
* DMI (Directional Movement Index) 
* SUPERTREND ICHIMOKU + SUPERTREND DMI 
* DONCHIAN CANAL Optimized with Colored Bars 
* HMA Hull 
* Fair Value GAP 
* VOLUME/ MA Volume 
* PRICE / MA Price 
* HHLL BOXES 
All these indications are visible simultaneously on a single graph. A data table summarizes all the important information to make a good trade decision.
ICHIMOKU Indicator: 
The ICHIMOKU indicator is visualized in the traditional way.
 ICHIMOKU standard setting values are respected but modifiable. (Traditional defaults =  . 
An oriented visual symbol, near the last value, indicates the progression (Ascending, Descending or neutral) of the TENKAN-SEN and the KIJUN-SEN as well as the period used. 
The CLOUD (KUMO) and the CHIKOU-SPAN are present and are essential for the complete analysis of the ICHIMOKU. 
At the top of the graph are visually represented the crossings of the TENKAN and the KIJUN. 
Vertical lines, accompanied by labels, make it possible to quickly visualize the particularities of the ICHIMOKU. 
A line displays the current bar. 
A line visualizes the end of the CLOUD (KUMO) which is shifted 25 bars into the future. 
A line visualizes the end of the chikou-span, which is shifted 25 bars in the past. 
DIRECTIONAL MOVEMENT INDEX (DMI) :  Treated conventionally : DI+, DI-, ADX and associated with a SUPERTREND DMI. 
A visual symbol at the bottom of the graph indicates DI+ and DI- crossings 
A line of oriented and colored symbols (DMI Line) at the top of the chart indicates the direction and strength of the trend.
SUPERTREND ICHIMOKU + SUPERTREND DMI : 
Trend following by SUPERTREND calculation. 
DONCHIAN CHANNEL: Treated conventionally. (And optimized by colored bars when overshooting either up or down.
The lines, high and low of the last values of the channel are represented to quickly visualize the level of the RANGE. 
SUPERTREND HMA (HULL) Treated conventionally. 
The HMA line visually indicates, according to color and direction, the market trend. 
A visual symbol at the bottom of the chart indicates opportunities to sell and buy. 
VOLUME: 
Calculation of the MOBILE AVERAGE of the volume with comparison of the volume compared to the moving average of the volume. 
The indications are colored and commented according to the comparison. 
PRICE: Calculation of the MOBILE AVERAGE of the price with comparison of the price compared to the moving average of the price. 
The indications are colored and commented according to the comparison. 
HHLL BOXES: 
Visualizes in the form of a box, for a given period, the max high and min low values of the price. 
The configuration allows taking into account the high and low wicks of the price or the opening and closing values. 
FAIR VALUE GAP : 
This indicator displays 'GAP' levels over the current time period and an optional higher time period. 
The script takes into account the high/low values of the current bar and compares with the 2 previous bars. 
The "gap" is generated from the lack of overlap between these bars. Bearish or bullish gaps are determined by whether the gap is above or below HmaPrice, as they tend to fill, and can be used as targets. 
NOTE: FAIR VALUE GAP has no values displayed in the table and/or label. 
Important information (DATA) relating to each indicator is displayed in real time in a table and/or a label.
 Each information is commented and colored according to direction, value, comparison etc. 
Each piece of information indicates the values of the current bar and the previous value (in "FULL" mode). 
The other possible modes for viewing the table and/or the label allow a more synthetic view of the information ("CONDENSED" and "MINIMAL" modes). 
In order not to overload the vision of the chart too much, the visualization box of the RANGE DONCHIAN, the vertical lines of the shifted marks of the ICHIMOKU, as well as the boxes of the HHLL Boxes indicator are only visualized intermittently (managed by an adjustable time delay  ). 
The "HISTORICAL INFO READING" configuration parameter set to zero (by default) makes it possible to read all the information of the current bar in progress (Bar #0). All other values allow to read the information of a historical bar. The value 1 reads the information of the bar preceding the current bar (-1). The value 10 makes it possible to read the information of the tenth bar behind (-10) compared to the current bar, etc. 
At the bottom of the DATAS table and label, lights, red, green or white indicate quickly summarize the trend from the various indicators. 
Each light represents the number of indicators with the same trend at a given time. 
Green for a bullish trend, red for a bearish trend and white for a neutral trend. 
The conditions for determining a trend are for each indicator: 
SUPERTREND  ICHIMOHU + DMI: the 2 Super trends together are either bullish or bearish. 
Otherwise the signal is neutral. 
DMI: 2 main conditions: 
BULLISH if DI+ >= DI- and ADX >25. 
BEARISH if DI+ < DI- and ADX >25. 
NEUTRAL if the 2 conditions are not met.
ICHIMOKU: 3 main conditions: 
BULLISH if PRICE above the cloud and TENKAN > KIJUN and GREEN CLOUD AHEAD. 
BEARISH if PRICE below the cloud and TENKAN < KIJUN and RED CLOUD AHEAD. 
The other additional conditions (Data) complete the analysis and are present for informational purposes of the trend and depend on the context. 
DONCHIAN CHANNEL: 1 main condition: 
BULLISH: the price has crossed above the HIGH DC line. 
BEARISH: the price has gone below the LOW DC line. 
NEUTRAL if the price is between the HIGH DC and LOW DC lines 
The 2 other complementary conditions (Datas) complete the analysis: 
HIGH DC and LOW DC are increasing, falling or stable. 
SUPERTREND HMA HULL: The script determines several trend levels: 
STRONG BUY, BUY, STRONG SELL, SELL AND NEUTRAL. 
VOLUME: 3 trend levels: 
VOLUME > MOVING AVERAGE, 
VOLUME < MOVING AVERAGE, 
VOLUME = MOVING AVERAGE. 
PRICE: 3 trend levels: 
PRICE > MOVING AVERAGE, 
PRICE < MOVING AVERAGE, 
PRICE = MOVING AVERAGE. 
If you are using this indicator/strategy and you are satisfied with the results, you can possibly make a donation (a coffee, a pizza or more...) via paypal to: lebourg.regis@free.fr. 
Thanks in advance !!! 
Have good winning Trades.
**************************************************************************************************************************
SUPERTREND MIXED ICHI-DMI-VOL-GAP-HLBox@RL
by RegisL76
Ce script est basé sur plusieurs indicateurs de tendance.
* ICHIMOKU (KINKO HYO)
* DMI (Directional Movement Index)
* SUPERTREND ICHIMOKU +  SUPERTREND DMI
* DONCHIAN CANAL Optimized with Colored Bars
* HMA Hull
* Fair Value GAP
* VOLUME/ MA Volume
* PRIX / MA Prix
* HHLL BOXES
Toutes ces indications sont visibles simultanément sur un seul et même graphique.
Un tableau de données récapitule toutes les informations importantes pour prendre une bonne décision de Trade.
I- Indicateur ICHIMOKU : 
L’indicateur ICHIMOKU est visualisé de manière traditionnelle
Les valeurs de réglage standard ICHIMOKU sont respectées mais modifiables. (Valeurs traditionnelles par défaut =  
Un symbole visuel orienté, à proximité de la dernière valeur, indique la progression (Montant, Descendant ou neutre) de la TENKAN-SEN et de la KIJUN-SEN ainsi que la période utilisée. 
Le NUAGE (KUMO) et la CHIKOU-SPAN sont bien présents et sont primordiaux pour l'analyse complète de l'ICHIMOKU.
En haut du graphique sont représentés visuellement les croisements de la TENKAN et de la KIJUN.
Des lignes verticales, accompagnées d'étiquettes, permettent de visualiser rapidement les particularités de l'ICHIMOKU.
Une ligne visualise la barre en cours.
Une ligne visualise l'extrémité du NUAGE (KUMO) qui est décalé de 25 barres dans le futur.
Une ligne visualise l'extrémité de la chikou-span, qui est décalée de 25 barres dans le passé.
II-DIRECTIONAL MOVEMENT INDEX (DMI)
Traité de manière conventionnelle : DI+, DI-, ADX et associé à un SUPERTREND DMI
Un symbole visuel en bas du graphique indique les croisements DI+ et DI-
Une ligne de symboles orientés et colorés (DMI Line) en haut du graphique, indique la direction et la puissance de la tendance.
III SUPERTREND ICHIMOKU + SUPERTREND DMI
Suivi de tendance par calcul SUPERTREND
IV- DONCHIAN CANAL : 
Traité de manière conventionnelle.
(Et optimisé par des barres colorées en cas de dépassement soit vers le haut, soit vers le bas.
Les lignes, haute et basse des dernières valeurs du canal sont représentées pour visualiser rapidement la fourchette du RANGE. 
V- SUPERTREND HMA (HULL)
Traité de manière conventionnelle.
La ligne HMA indique visuellement, selon la couleur et l'orientation, la tendance du marché.
Un symbole visuel en bas du graphique indique les opportunités de vente et d'achat.
*VI VOLUME : 
Calcul de la MOYENNE MOBILE du volume avec comparaison du volume par rapport à la moyenne mobile du volume.
Les indications sont colorées et commentées en fonction de la comparaison.
*VII PRIX : 
Calcul de la MOYENNE MOBILE du prix avec comparaison du prix par rapport à la moyenne mobile du prix.
Les indications sont colorées et commentées en fonction de la comparaison.
*VIII HHLL BOXES : 
Visualise sous forme de boite, pour une période donnée, les valeurs max hautes et min basses du prix.
La configuration permet de prendre en compte les mèches hautes et basses du prix ou bien les valeurs d'ouverture et de fermeture.
IX - FAIR VALUE GAP
Cet indicateur affiche les niveaux de 'GAP' sur la période temporelle actuelle ET une période temporelle facultative supérieure.
Le script prend en compte les valeurs haut/bas de la barre actuelle  et compare avec les 2 barres précédentes.
Le "gap" est généré à partir du manque de recouvrement entre ces barres.
Les écarts baissiers ou haussiers sont déterminés selon que l'écart est supérieurs ou inférieur à HmaPrice, car ils ont tendance à être comblés, et peuvent être utilisés comme cibles.
NOTA : FAIR VALUE GAP n'a pas de valeurs affichées dans la table et/ou l'étiquette.
Les informations importantes (DATAS) relatives à chaque indicateur sont visualisées en temps réel dans une table et/ou une étiquette.
Chaque information est commentée et colorée en fonction de la direction, de la valeur, de la comparaison etc.
Chaque information indique la valeurs de la barre en cours et la valeur précédente ( en mode "COMPLET").
Les autres modes possibles pour visualiser la table et/ou l'étiquette, permettent une vue plus synthétique des informations (modes "CONDENSÉ" et "MINIMAL").
Afin de ne pas trop surcharger la vision du graphique, la boite de visualisation du RANGE DONCHIAN, les lignes verticales des marques décalées de l'ICHIMOKU, ainsi que les boites de l'indicateur HHLL Boxes ne sont visualisées que de manière intermittente (géré par une temporisation réglable  ).
Le paramètre de configuration "HISTORICAL INFO READING" réglé sur zéro (par défaut) permet de lire toutes les informations de la barre actuelle en cours (Barre #0).
Toutes autres valeurs permet de lire les informations d'une barre historique. La valeur 1 permet de lire les informations de la barre précédant la barre en cours (-1).
La valeur 10 permet de lire les information de la dixième barre en arrière (-10) par rapport à la barre en cours, etc.
Dans le bas de la table et de l'étiquette de DATAS, des voyants, rouge, vert ou blanc indique de manière rapide la synthèse de la tendance issue des différents indicateurs.
Chaque voyant représente le nombre d'indicateur ayant la même tendance à un instant donné. Vert pour une tendance Bullish, rouge pour une tendance Bearish et blanc pour une tendance neutre.
Les conditions pour déterminer une tendance sont pour chaque indicateur :
SUPERTREND ICHIMOHU + DMI : les 2 Super trends sont ensemble soit bullish soit Bearish. Sinon le signal est neutre.
DMI : 2 conditions principales : 
BULLISH si DI+ >= DI- et ADX >25.
BEARISH si DI+ <  DI- et ADX >25.
NEUTRE si les 2 conditions ne sont pas remplies.
ICHIMOKU : 3 conditions principales :
BULLISH si PRIX au dessus du nuage  et TENKAN > KIJUN et NUAGE VERT DEVANT.
BEARISH si PRIX en dessous du nuage et TENKAN < KIJUN et NUAGE ROUGE DEVANT.
Les autres conditions complémentaires (Datas) complètent l'analyse et sont présents à titre informatif de la tendance et dépendent du contexte.
CANAL DONCHIAN : 1 condition principale : 
BULLISH : le prix est passé au dessus de la ligne HIGH DC.
BEARISH : le prix est passé au dessous de la ligne LOW DC.
NEUTRE si le prix se situe entre les lignes  HIGH DC et LOW DC
Les 2 autres conditions complémentaires (Datas) complètent l'analyse : HIGH DC  et LOW DC sont croissants, descendants ou stables.
SUPERTREND HMA HULL : 
Le script détermine plusieurs niveaux de tendance :
STRONG BUY, BUY, STRONG SELL, SELL ET NEUTRE.
VOLUME : 3 niveaux de tendance : 
VOLUME > MOYENNE MOBILE, VOLUME < MOYENNE MOBILE, VOLUME = MOYENNE MOBILE.
PRIX : 3 niveaux de tendance : 
PRIX > MOYENNE MOBILE, PRIX < MOYENNE MOBILE, PRIX = MOYENNE MOBILE.
Si vous utilisez cet indicateur/ stratégie et que vous êtes satisfait des résultats, 
 vous pouvez éventuellement me faire un don (un café, une pizza ou plus ...) via paypal à : lebourg.regis@free.fr.
 Merci d'avance !!!
Ayez de bons Trades gagnants.
Modified ATR Indicator [KL]Modified Average True Range (ATR) Indicator 
This indicator displays the ATR with  relative highs  and  relative lows  statistically determined.
 What is ATR: 
To know what ATR is, we need to understand what a True Range (TR) is.
- TR at a given bar is the highest distance between points: a) High vs low, b) High vs Close, and c) Low vs Close. 
- ATR is the moving average of TRs over a predefined lookback period; 14 is the most commonly used.
- ATR can be mathematically expressed as:
  
 Why is ATR Important 
ATR often used to measure volatility; high volatility is indicated by high ATR, vice versa for low. This is a versatile tool allowing traders to determine entry/exit points, as well as the size of stop losses and when to take profits relative to it. 
 
This is an opinion: Through observations, I have noticed that ATR can also indirectly tell us the levels of relative volume. This intuitively makes sense because in order to increase length of TR, high amounts of capital inflow/outflow is required (graphically speaking, high volume is required in order to make lengths of candle sticks longer). The relationship between ATR and relative volume should hold unless the market is illiquid to the extreme that there is no relationship between volume and price.
That said, knowing the relative lows/highs of ATR is very useful. It can be interpreted as:
- Relative high = high volatility, usually during sell offs
- Relative low = decreasing volume, could indicate price consolidation 
Instead of arbitrarily determining whether ATR is high/low, this indicator will determine  relative highs  and  relative lows  using a simple statistical model.
 How relative high/low is determined by this model 
This indicator applies two-tailed hypothesis testing to test whether ATR (ie. say lookback of 14) has greatly deviated from a larger sample size (ie. lookback of 50). Assuming ATR is normally distributed and variance is known, then test statistic (z) can be used to determine whether ATR14 is within the critical area under Null Hypothesis: ATR14 == ATR50. If z falls below/above the left/right critical values (ie. 1.645 for a 90% confidence interval), then this is shown by the indicator through using different colors to plot the ATR line.
Double Top/BottomHere is an attempt to identify double top/bottom based on pivot high/lows.
Logic is simple.
 Double Bottom: 
 
  Last two pivot High Lows make W shape
  Last Pivot Low is higher than previous Last Pivot Low.
  Last Pivot High is lower than previous last Pivot High.
  Price has not gone below Last Pivot Low
  Price breaks out of last Pivot High to complete W shape
 
 Double Top: 
 
  Last two pivot High Lows make M shape
  Last Pivot Low is higher than previous Last Pivot Low.
  Last Pivot High is lower than previous last Pivot High.
  Price has not gone above Last Pivot High
  Price breaks out of last Pivot Low to complete M shape
 
 Prameters: 
 
  Parameters  PvtLenL ,  PvtLenR  and  waitforclose  determines pivot points.
   FilterPivots  clears repetitive pivots formed in same direction before calculating the possible double top/bottom. 
For example:
   CheckForAbsolutePeaks  and  AbsolutePeakLoopback  works together. When  CheckForAbsolutePeaks  is enabled, script only generates double bottom or top signal if previous last pivot is absolute high or low for  AbsolutePeakLoopback  periods.
  ConsiderMovingAverage does two things. First, it makes sure that fast moving average and slow moving averages are aligned with the direction we are going to forecast. Second, it makes sure that the crossover happend recently and with last  BarCrossoverLimit  bars. For example, to call it double bottom, Fast MA should be higher than Slow MA and crossover of FastMA above SlowMA should have happened in last 10 bars (BarCrossoverLimit)
   PivotDisplayMode  can be Actual, Filtered or None. Actual will display all pivot high low generated.  Filtered will only display last 5 pivot high and pivot lows which are filtered . That means, it will remove the repetitive pivots formed without making pivots on the other side.
Welcome and suggestions and feedbacks.
Relative Volume at Time█  OVERVIEW 
This indicator calculates relative volume, which is the ratio of present volume over an average of past volume.
It offers two calculation modes, both using a time reference as an anchor.
                                        
█  CONCEPTS 
 Calculation modes 
The simplest way to calculate relative volume is by using the ratio of a bar's volume over a simple moving average of the last  n  volume values. 
This indicator uses one of two, more subtle ways to calculate both values of the relative volume ratio:  current volume:past volume . 
The two calculations modes are:
 1 —  Cumulate from Beginning of TF to Current Bar  where:
    current volume  = the cumulative volume since the beginning of the timeframe unit, and
    past volume  = the mean of volume during that same relative period of time in the past  n  timeframe units.
 2 —  Point-to-Point Bars at Same Offset from Beginning of TF  where:
    current volume  = the volume on a single chart bar, and
    past volume  = the mean of volume values from that same relative bar in time from the past  n  timeframe units.
 Timeframe units 
Timeframe units can be defined in three different ways:
 1 — Using Auto-steps, where the timeframe unit automatically adjusts to the timeframe used on the chart:
    — A 1 min timeframe unit will be used on 1sec charts,
    — 1H will be used for charts at 1min and less,
    — 1D will be used for other intraday chart timeframes,
    — 1W will be used for 1D charts,
    — 1M will be used for charts at less than 1M,
    — 1Y will be used for charts at greater or equal than 1M.
 2 — As a fixed timeframe that you define.
 3 — By time of day (for intraday chart timeframes only), which you also define. If you use non-intraday chart timeframes in this mode, the indicator will switch to Auto-steps.
 Relative Relativity 
A relative volume value of 1.0 indicates that  current volume  is equal to the mean of  past volume , but how can we determine what constitutes a high relative volume value? 
The traditional way is to settle for an arbitrary threshold, with 2.0 often used to indicate that relative volume is worthy of attention.
We wanted to provide traders with a contextual method of calculating threshold values, so in addition to the conventional fixed threshold value, 
this indicator includes two methods of calculating a threshold  channel  on past relative volume values:
 1 — Using the standard deviation of relative volume over a fixed lookback.
 2 — Using the highs/lows of relative volume over a variable lookback.
Channels calculated on relative volume provide meta-relativity, if you will, as they are relative values of relative volume.
█  FEATURES 
Controls in the "Display" section of inputs determine what is visible in the indicator's pane. The next "Settings" section is where you configure the parameters used in the calculations. The "Column Coloring Conditions" section controls the color of the columns, which you will see in three of the five display modes available. Whether columns are plotted or not, the coloring conditions also determine when markers appear, if you have chosen to show the markers in the "Display" section. The presence of markers is what triggers the alerts configured on this indicator. Finally, the "Colors" section of inputs allows you to control the color of the indicator's visual components.
 Display 
Five display modes are available:
 •  Current Volume Columns : shows columns of  current volume , with  past volume  displayed as an outlined column.
 •  Relative Volume Columns : shows relative volume as a column.
 •  Relative Volume Columns With Average : shows relative volume as a column, with the average of relative volume.
 •  Directional Relative Volume Average : shows a line calculated using the average of +/- values of relative volume. 
  The positive value of relative volume is used on up bars; its negative value on down bars.
 •  Relative Volume Average : shows the average of relative volume.
A Hull moving average is used to calculate the average used in the three last display modes.
You can also control the display of:
 • The value or relative volume, when in the first three display modes. Only the last 500 values will be shown.
 • Timeframe transitions, shown in the background.
 • A reminder of the active timeframe unit, which appears to the right of the indicator's last bar.
 • The threshold used, which can be a fixed value or a channel, as determined in the next "Settings" section of inputs.
 • Up/Down markers, which appear on transitions of the color of the volume columns (determined by coloring conditions), which in turn control when alerts are triggered.
 • Conditions of high volatility.
 Settings 
Use this section of inputs to change:
 •  Calculation mode : this is where you select one of this indicator's two calculation modes for  current volume  and  past volume , as explained in the "Concepts" section.
 •  Past Volume Lookback in TF units : the quantity of timeframe units used in the calculation of  past volume .
 •  Define Timeframes Units Using : the mode used to determine what one timeframe unit is. Note that when using a fixed timeframe, it must be higher than the chart's timeframe.
  Also, note that time of day timeframe units only work on intraday chart timeframes.
 •  Threshold Mode : Five different modes can be selected:
   —  Fixed Value : You can define the value using the "Fixed Threshold" field below. The default value is 2.0.
   —  Standard Deviation Channel From Fixed Lookback : This is a channel calculated using the simple moving average of relative volume
    (so not the Hull moving average used elsewhere in the indicator), plus/minus the standard deviation multiplied by a user-defined factor.
    The lookback used is the value of the "Channel Lookback" field. Its default is 100.
   —  High/Low Channel From Beginning of TF : in this mode, the High/Low values reset at the beginning of each timeframe unit.
   —  High/Low Channel From Beginning of Past Volume Lookback : in this mode, the High/Low values start from the farthest point back where we are calculating  past volume , 
    which is determined by the combination of timeframe units and the "Past Volume Lookback in TF units" value.
   —  High/Low Channel From Fixed Lookback : In this mode the lookback is fixed. You can define the value using the "Channel Lookback" field. The default value is 100.
 •  Period of RelVol Moving Average : the period of the Hull moving average used in the "Directional Relative Volume Average" and the "Relative Volume Average".
 •  High Volatility  is defined using fast and slow ATR periods, so this represents the volatility of price. 
  Volatility is considered to be high when the fast ATR value is greater than its slow value. Volatility can be used as a filter in the column coloring conditions.
 Column Coloring Conditions 
 • Eight different conditions can be turned on or off to determine the color of the volume columns. All "ON" conditions must be met to determine a high/low state of relative volume,
  or, in the case of directional relative volume, a bull/bear state.
 • A volatility state can also be used to filter the conditions.
 • When the coloring conditions and the filter do not allow for a high/low state to be determined, the neutral color is used.
 • Transitions of the color of the volume columns determined by coloring conditions are used to plot the up/down markers, which in turn control when alerts are triggered.
 Colors 
 • You can define your own colors for all of the oscillator's plots.
 • The default colors will perform well on light or dark chart backgrounds.
 Alerts 
 • An alert can be defined for the script. The alert will trigger whenever an up/down marker appears in the indicator's display.
  The particular combination of coloring conditions and the display settings for up/down markers when you create the alert will determine which conditions trigger the alert.
  After alerts are created, subsequent changes to the conditions controlling the display of markers will not affect existing alerts.
 • By configuring the script's inputs in different ways before you create your alerts, you can create multiple, functionally distinct alerts from this script.
  When creating multiple alerts, it is useful to include in the alert's message a reminder of the particular conditions you used for each alert.
 • As is usually the case, alerts triggering "Once Per Bar Close" will prevent repainting.
 Error messages 
Error messages will appear at the end of the chart upon the following conditions:
 • When the combination of the timeframe units used and the "Past Volume Lookback in TF units" value create a lookback that is greater than 5000 bars. 
  The lookback will then be recalculated to a value such that a runtime error does not occur.
 • If the chart's timeframe is higher than the timeframe units. This error cannot occur when using Auto-steps to calculate timeframe units.
 • If relative volume cannot be calculated, for example, when no volume data is available for the chart's symbol.
 • When the threshold of relative volume is configured to be visible but the indicator's scale does not allow it to be visible (in "Current Volume Columns" display mode).
█  NOTES 
 For traders 
The chart shown here uses the following display modes: "Current Volume Columns", "Relative Volume Columns With Average", "Directional Relative Volume Average" and "Relative Volume Average". The last one also shows the threshold channel in standard deviation mode, and the TF Unit reminder to the right, in red.
Volume, like price, is a value with a market-dependent scale. The only valid reference for volume being its past values, any improvement in the way past volume is calculated thus represents a potential opportunity to traders. Relative volume calculated as it is here can help traders extract useful information from markets in many circumstances, markets with cyclical volume such as Forex being one, obvious case. The relative nature of the values calculated by this indicator also make it a natural fit for cross-market and cross-sector analysis, or to identify behavioral changes in the different futures contracts of the same market. Relative volume can also be put to more exotic uses, such as in evaluating changes in the popularity of exchanges.
Relative volume alone has no directional bias. While higher relative volume values always indicate higher trading activity, that activity does not necessarily translate into significant price movement. In a tightly fought battle between buyers and sellers, you could theoretically have very large volume for many bars, with no change whatsoever in bid/ask prices. This of course, is unlikely to happen in reality, and so traders are justified in considering high relative volume values as indicating periods where more attention is required, because imbalances in the strength of buying/selling power during high-volume trading periods can amplify price variations, providing traders with the generally useful gift of volatility.
Be sure to give the "Directional Relative Volume Average" a try. Contrary to the always-positive ratio widely used in this indicator, the "Directional Relative Volume Average" produces a value able to determine a bullish/bearish bias for relative volume.
Note that realtime bars must be complete for the relative volume value to be confirmed. Values calculated on historical or elapsed realtime bars will not recalculate unless historical volume data changes.
Finally, as with all indicators using volume information, keep in mind that some exchanges/brokers supply different feeds for intraday and daily data, and the volume data on both feeds can sometimes vary quite a bit.
 For coders 
Our script was written using the  PineCoders Coding Conventions for Pine .
The description was formatted using the techniques explained in the  How We Write and Format Script Descriptions  PineCoders publication.
Bits and pieces of code were lifted from the  MTF Selection Framework  and the  MTF Oscillator Framework , also by PineCoders.
█  THANKS 
Thanks to  dgtrd  for suggesting to add the channel using standard deviation.
Thanks to  adolgov  for helpful suggestions on calculations and visuals.
 Look first. Then leap.  
Rabbit HoleHow deep is the Rabbit hole? Interesting experiment that finds the RISING HIGHS and FALLING LOWS and place the difference between the highs and lows into separate arrays.
== Calculations ==
In case current high is higher than previous high, we calculate the value by subtracting the current highest high with the previous High (lowest high) into array A, 
same method for the lows just in Array B.
Since we subtract highs and lows it means velocity is taken into consideration with the plotting.
After adding a new value we remove the oldest value if the array is bigger than the Look back length. This is done for both lows and highs array.
Afterwards we sum up the lows and highs array (separately) and plot them separately, We can also smooth them a bit with Moving averages like HMA, JMA, KAMA and more.
== RULES ==
When High Lines crosses the Low Line we get a GREEN tunnel.
When Low Lines crosses the High line we get the RED tunnel.
The Greenish the stronger the up trend.
The Redish the stronger the downtrend.
== NOTES ==
Bars are not colored by default.
Better for higher time frames, 1 hour and above.
Enjoy and like if you like!
Follow up for new scripts: www.tradingview.com
Extrapolated Pivot Connector - Lets Make Support And ResistancesIntroduction 
The support and resistance methodology remain the most used one in technical analysis, this is mainly due to its simplicity, and unlike lots of techniques used in technical analysis support and resistances have a certain logic, price can sometimes appear moving into a channel, support and resistances allow the trader to estimate such channel and project it into the future in order to spot points where price might reverse direction. 
In this script a simple linear support and resistance indicator is proposed, the indicator is made by connecting past pivot high's/low's to more recent ones and extrapolating the resulting connection. The indicator is also able to make support and resistances by using other indicators as input.
 Indicator Settings  
The indicator include various settings, the first one being the length setting who determine the sensitivity of the pivot high/low detection, low values of length will detect the pivot high/low of noisy variations, while higher values will detect the pivot high/low of longer term variations.
  
The figure above use length = 5.
The A-High parameter determine the position of the pivot high to be used as first point of the resistance line, higher values will use oldest pivot high's as first point. The B-High parameter determine the last pivot high. A-Low and B-Low work the same way but affect the support line, a label is drawn on the chart in order to help you determine the position of A/B-High/Low.
 Using Other Indicators Output As Input 
The "Use Custom Source" option allow you to apply the indicator to other indicators, for example we can use a moving average of period 50 as input 
  
Or the rsi :
  
Let me help you set the proposed indicator easily to indicators appearing on a separate window, for example the momentum oscillator, add the momentum oscillator to the chart, to do so click on indicator and search "momentum", click on the first result, once on the chart put your mouse pointer on the indicator title, you'll see appearing the hide, settings and delete option, at the right of delete you should see three dots which represent the "more" option, click on it and select "Add indicator on Mom" and select the extrapolated pivot indicator, you can do that by searching it, altho it might be easier to do it by adding the indicator to favorites first, you then only need to select it from your favorites.
You might see a mess on the indicator window, thats because the extrapolated pivot is still using high and low as input, go to the settings of the extrapolated pivot indicator and check "Use Custom Source", it should appear properly now.
  
 Tips And Tricks When Using Support And Resistances 
  
Linear support and resistances assume an approximately linear trend, if you see non linear growth in the price evolution you can use a logarithmic scale in order to have a more linear evolution. To do so right click on the the chart scale and select "Logarithmic" or use the following key shortcut "alt + l".
When applying the indicator to an oscillator centered around zero make sure to adjust the settings of the oscillator such that the peak magnitude of the oscillator is relatively constant over time.
  
Here a roc of period 9 has non constant peak amplitude, you can see that by looking at the position of the pivots (circles), increasing the period of the roc help capture more significant pivots high's/low's
  
 Conclusion 
In this post an indicator aiming to draw support and resistances is presented, the fact that it can be applied to any other indicator is a relatively nice option, and i hope you might make use of this feature. 
The code make heavy use of the new features that where integrated on the v4 of pine, such features are really focused on making figures and labels, things i don't really work with, but it is nice to step out my short codes habits, and i don't exclude working with figures in pine in the future. 
Thanks for reading !
iFVG Strategie by Futures.RobbyiFVG Strategy Checklist by Futures.Robby
Updated: October 27, 2025
Description
This script is a manual checklist designed to help traders evaluate their setups based on the iFVG (Fair Value Gap) strategy. It serves solely as a visual aid and does not perform automatic analysis, signal generation, or trade execution.
How It Works
The script creates an interactive checklist directly on the chart. Traders manually select which criteria are met, and the script calculates a percentage score, displaying it with color coding:
Green (≥ 60%): Good fulfillment of criteria
Orange (40–59%): Partial fulfillment
Red (< 40%): Poor fulfillment
Checklist Criteria
The checklist is divided into two main sections:
1. Trade Criteria (8 Points)
Eight manually selectable criteria to assess setup quality:
Trade im Bias → Trade in Bias: Trade follows the higher timeframe trend (H1/H4/Daily).
BE Level → BE Level: Swing point between entry and target.
Sweep → Sweep: Price hits a key swing before reversing.
Displacement → Displacement: iFVG broken by strong candles.
Leg FVG geschlossen → Leg FVG Closed: No open m1 to m5 FVGs to target.
FVG Reaktion → FVG Reaction: Reaction at FVG during sweep (HTF).
FVG Größe → FVG Size: 6 to 10 points.
Anzahl Kerzen → Number of Candles: Maximum of 6 candles.
2. Goals (1 Point)
Six optional goal conditions, counted together as 1 point:
Equal H / L → Equal High/Low
Session H / L → Session High/Low
News H / L → News High/Low
HTF Swing Point → HTF Swing Point
HTF OB → HTF Order Block
HTF FVG → HTF FVG
Settings and Customization
The script’s settings are translated as follows:
Group: Trade Criteria
Trade im Bias → Trade in Bias
Tooltip: Trendrichtung folgt HTF (H1/H4/Täglich) – Trend follows HTF direction
BE Level → BE Level
Tooltip: Swingpunkt zwischen Einstieg und Ziel – Swing point between entry and target
Sweep → Sweep
Tooltip: Kurs erreicht markanten Swing – Price hits key swing before inverse
Displacement → Displacement
Tooltip: iFVG durch starke Kerzen gebrochen – iFVG broken by strong candles
Leg FVG geschlossen → Leg FVG Closed
Tooltip: Keine offenen m1 bis m5 FVGs bis Ziel – No open m1 to m5 FVGs to target
FVG Reaktion → FVG Reaction
Tooltip: Reaktion an FVG beim Sweep (HTF) – Reaction at FVG during sweep (HTF)
FVG Größe → FVG Size
Tooltip: 6 bis 10 Punkte – 6 to 10 points
Anzahl Kerzen → Number of Candles
Tooltip: Maximal 6 Kerzen – Maximum of 6 candles
Group: Goals
Equal H / L → Equal High/Low
Session H / L → Session High/Low
News H / L → News High/Low
HTF Swing Point → HTF Swing Point
HTF OB → HTF Order Block
HTF FVG → HTF FVG
ℹ️ Ziele zählen gemeinsam als 1 Punkt → ℹ️ Goals count together as 1 point
Window Position & Size
Fensterposition → Window Position
oben rechts → top right
oben links → top left
unten rechts → bottom right
unten links → bottom left
Tabellengröße → Table Size
normal → normal
small → small
tiny → tiny
Translation of Chart Table Contents
The table headers and entries on the chart are translated as follows:
Table Headers:
Trade Checkliste → Trade Checklist
Ziele → Goals
Status Symbols:
✅ → ✅ (Fulfilled)
❌ → ❌ (Not fulfilled)
Individual Criteria (Trade Criteria):
Trade im Bias → Trade in Bias
BE Level → BE Level
Sweep → Sweep
Displacement → Displacement
Leg FVG geschlossen → Leg FVG Closed
FVG Reaktion → FVG Reaction
FVG Größe → FVG Size
Anzahl Kerzen → Number of Candles
Individual Criteria (Goals):
Equal H / L → Equal High/Low
Session H / L → Session High/Low
News H / L → News High/Low
HTF Swing Point → HTF Swing Point
HTF OB → HTF Order Block
HTF FVG → HTF FVG
Note Line:
Ziele zählen gemeinsam als 1 Punkt → Goals count together as 1 point
Important Note
This tool is not an automated indicator, but a visual decision aid for traders who want to apply their strategy in a structured and conscious way.
Fib OscillatorWhat is Fib Oscillator and How to Use it?
🔶 1. Conceptual Overview
The Fib Oscillator is a Fibonacci-based relative position oscillator.
Instead of measuring momentum (like RSI or MACD), it measures where price currently sits between the recent swing high and swing low, expressed as a percentage within the Fibonacci range.
In other words:
It answers: “Where is price right now within its most recent dynamic range?”
It visualizes retracement and extension zones numerically, providing continuous feedback between 0% and 100% (and beyond if extended).
🔶 2. What the Script Does
The indicator:
Automatically detects recent high and low levels using an adaptive lookback window, which depends on ATR volatility.
Calculates the current price’s position between those levels as a percentage (0–100).
Plots that percentage as an oscillator — showing visually whether price is near the top, middle, or bottom of its recent range.
Overlays Fibonacci retracement levels (23.6%, 38.2%, 50%, 61.8%, 78.6%) as reference zones.
Generates alerts when the oscillator crosses key Fib thresholds — which can signal retracement completion, breakout potential, or pullback exhaustion.
🔶 3. Technical Flow Breakdown
(a) Inputs
Input	Description	Default	Notes
atrLength	ATR period used for volatility estimation	14	Used to dynamically tune lookback sensitivity
minLookback	Minimum lookback window (candles)	20	Ensures stability even in low volatility
maxLookback	Maximum lookback window	100	Limits over-expansion during high volatility
isInverse	Inverts chart orientation	false	Useful for inverse markets (e.g. shorts or inverse BTC view)
(b) Volatility-Adaptive Lookback
Instead of using a fixed lookback, it calculates:
lookback
=
SMA(ATR,10)
/
SMA(Close,10)
×
500
lookback=SMA(ATR,10)/SMA(Close,10)×500
Then it clamps this between minLookback and maxLookback.
This makes the oscillator:
More reactive during high volatility (shorter lookback)
More stable during calm markets (longer lookback)
Essentially, it self-adjusts to market rhythm — you don’t have to constantly tweak lookback manually.
(c) High-Low Reference Points
It takes the highest and lowest points within the dynamic lookback window.
If isInverse = true, it flips the candle logic (useful if viewing inverse instruments like stablecoin pairs or when analyzing bearish setups invertedly).
(d) Oscillator Core
The main oscillator line:
osc
=
(
close
−
low
)
(
high
−
low
)
×
100
osc=
(high−low)
(close−low)
	
×100
0% = Price is at the lookback low.
100% = Price is at the lookback high.
50% = Midpoint (balanced).
Between Fibonacci percentages (23.6%, 38.2%, 61.8%, etc.), the oscillator indicates retracement stages.
(e) Fibonacci Levels as Reference
It overlays horizontal reference lines at:
0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%
These act as support/resistance bands in oscillator space.
You can read it similar to how traders use Fibonacci retracements on charts, but compressed into a single line oscillator.
(f) Alerts
The script includes built-in alert conditions for crossovers at each major Fibonacci level.
You can set TradingView alerts such as:
“Oscillator crossed above 61.8%” → possible bullish continuation or breakout.
“Oscillator crossed below 38.2%” → possible pullback or correction starting.
This allows automated monitoring of fib retracement completions without manually drawing fib levels.
🔶 4. How to Use It
🔸 Visual Interpretation
Oscillator Value	Zone	Market Context
0–23.6%	Deep Retracement	Potential exhaustion of a down-move / early reversal
23.6–38.2%	Shallow retracement zone	Possible continuation phase
38.2–50%	Mid retracement	Neutral or indecisive structure
50–61.8%	Key pivot region	Common trend resumption zone
61.8–78.6%	Late retracement	Often “last pullback” area
78.6–100%	Near high range	Possible overextension / profit-taking
>100%	Range breakout	New leg formation / expansion
🔸 Practical Application Steps
Load the indicator on your chart (set overlay = false, so it’s below the main price chart).
Observe oscillator position relative to fib bands:
Use it to determine retracement depth.
Combine with structure tools:
Trend lines, swing points, or HTF market structure.
Use crossovers for timing:
Crossing above 61.8% in an uptrend often confirms breakout continuation.
Crossing below 38.2% in a downtrend signals renewed downside momentum.
For range markets, oscillator swings between 23.6% and 78.6% can define accumulation/distribution boundaries.
🔶 5. When to Use It
During Retracements: To gauge how deep the pullback has gone.
During Range Markets: To identify relative overbought/oversold positions.
Before Breakouts: Crossovers of 61.8% or 78.6% often precede impulsive moves.
In Multi-Timeframe Contexts:
LTF (15M–1H): Detect intraday retracement exhaustion.
HTF (4H–1D): Confirm major range expansions or key reversal zones.
🔶 6. Ideal Companion Indicators
The Fib Oscillator works best when contextualized with structure, volatility, and trend bias indicators.
Below are optimal pairings:
Companion Indicator	Purpose	Integration Insight
Market Structure MTF Tool	Identify active trend direction	Use Fib Oscillator only in trend direction for cleaner signals
EMA Ribbon / Supertrend	Trend confirmation	Align oscillator crossovers with EMA bias
ATR Bands / Volatility Envelope	Validate breakout strength	If oscillator >78.6% & ATR rising → valid breakout
Volume Oscillator	Confirm retracement strength	Volume contraction + oscillator under 38.2% → potential reversal
HTF Fib Retracement Tool	Combine LTF oscillator with HTF fib confluence	Powerful multi-timeframe setups
RSI or Stochastic	Measure momentum relative to position	RSI divergence while oscillator near 78.6% → exhaustion clue
🔶 7. Understanding the Settings
Setting	Function	Practical Impact
ATR Period (14)	Controls volatility sampling	Higher = smoother lookback adaptation
Min Lookback (20)	Smallest window allowed	Lower = more reactive but noisier
Max Lookback (100)	Largest window allowed	Higher = smoother but slower to react
Inverse Candle Chart	Flips oscillator vertically	Useful when analyzing bearish or inverse scenarios (e.g. short-side fib mapping)
Recommended Configs:
For scalping/intraday: ATR 10–14, lookback 20–50
For swing/position trading: ATR 14–21, lookback 50–100
🔶 8. Example Trade Logic (Practical Use)
Scenario: Uptrend on 4H chart
Oscillator drops to below 38.2% → retracement zone
Price consolidates → oscillator stabilizes
Oscillator crosses above 50% → pullback ending
Entry: Long when oscillator crosses above 61.8%
Exit: Near 78.6–100% zone or upon divergence with RSI
For Short Bias (Inverse Setup):
Enable isInverse = true to visually flip the oscillator (so lows become highs).
Use the same thresholds inversely.
🔶 9. Strengths & Limitations
✅ Strengths
Dynamic, self-adapting to volatility
Quantifies Fib retracement as a continuous function
Compact oscillator view (no clutter on chart)
Works well across all timeframes
Compatible with both trending and ranging markets
⚠️ Limitations
Doesn’t define trend direction — must be used with structure filters
Can whipsaw during choppy consolidations
The “lookback auto-adjust” may lag in sudden volatility shifts
Shouldn’t be used standalone for entries without structural confluence
🔶 10. Summary
The “Fib Oscillator” is a dynamic Fibonacci-relative positioning tool that merges retracement theory with adaptive volatility logic.
It gives traders an intuitive, quantified view of where price sits within its recent fib range, allowing anticipation of pullbacks, reversals, or breakout momentum.
Think of it as a "Fibonacci RSI", but instead of momentum strength, it shows positional depth — the vibrational location of price within its natural swing cycle.
ICT Liquidity Sweep Asia/London 1 Trade per High & Low🧠 ICT Liquidity Sweep Asia/London — 1 Trade per High & Low
This strategy is inspired by the ICT (Inner Circle Trader) concepts of liquidity sweeps and market structure, focusing on the Asia and London sessions.
It automatically identifies liquidity grabs (sweeps) above or below key session highs/lows and enters trades with a fixed risk/reward ratio (RR).
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
⚙️ Core Logic
-Asia Session: 8:00 PM – 11:59 PM (New York time)
-London Session: 2:00 AM – 5:00 AM (New York time)
-The script marks the Asia High/Low and London High/Low ranges for each day.
-When the market sweeps above a session high → potential Short setup
-When the market sweeps below a session low → potential Long setup
-A trade is triggered when the confirmation candle closes in the opposite direction of the sweep (bearish after a high sweep, bullish after a low sweep).
-Only one trade per sweep type (1 per High, 1 per Low) is allowed per session.
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
📈 Risk Management
-Configurable Risk/Reward Target (default = 2:1)
-Configurable Position Size (number of contracts)
-Each trade uses a fixed Stop Loss (beyond the wick of the sweep) and a Take Profit calculated from the RR setting.
-All trades are automatically logged in the Strategy Tester with performance metrics.
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
💡 Features
✅ Visual session highlighting (Asia = Aqua, London = Orange)
✅ Automatic liquidity line plotting (session highs/lows)
✅ Entry & exit labels (optional visual display)
✅ Customizable RR and contract size
✅ Works on any instrument (ideal for indices, futures, or forex)
✅ Compatible with all timeframes (optimized for 1M–15M)
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
⚠️ Notes
-Best used on New York time-based charts.
-Designed for educational and backtesting purposes — not financial advice.
-Use as a foundation for further optimization (e.g., SMT confirmation, FVG filter, or time-based restrictions).
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
🧩 Recommended Use
Pair this with:
-ICT’s concepts like CISD (Change in State of Delivery) and FVGs (Fair Value Gaps)
-Higher timeframe liquidity maps
-Session bias or daily narrative filters
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Author: jygirouard
Strategy Version: 1.3
Type: ICT Liquidity Sweep Automation
Timezone: America/New_York
Adaptive Vol Gauge [ParadoxAlgo]This is an overlay tool that measures and shows market ups and downs (volatility) based on daily high and low prices. It adjusts automatically to recent price changes and highlights calm or wild market periods. It colors the chart background and bars in shades of blue to cyan, with optional small labels for changes in market mood. Use it for info only—combine with your own analysis and risk controls. It's not a buy/sell signal or promise of results.Key FeaturesSmart Volatility Measure: Tracks price swings with a flexible time window that reacts to market speed.
Market Mood Detection: Spots high-energy (wild) or low-energy (calm) phases to help see shifts.
Visual Style: Uses smooth color fades on the background and bars—cyan for calm, deep blue for wild—to blend nicely on your chart.
Custom Options: Change settings like time periods, sensitivity, colors, and labels.
Chart Fit: Sits right on your main price chart without extra lines, keeping things clean.
How It WorksThe tool figures out volatility like this:Adjustment Factor:Looks at recent price ranges compared to longer ones.
Tweaks the time window (between 10-50 bars) based on how fast prices are moving.
Volatility Calc:Adds up logs of high/low ranges over the adjusted window.
Takes the square root for the final value.
Can scale it to yearly terms for easy comparison across chart timeframes.
Mood Check:Compares current volatility to its recent average and spread.
Flags "high" if above your set level, "low" if below.
Neutral in between.
This setup makes it quicker in busy markets and steadier in quiet ones.Settings You Can ChangeAdjust in the tool's menu:Base Time Window (default: 20): Starting point for calculations. Bigger numbers smooth things out but might miss quick changes.
Adjustment Strength (default: 0.5): How much it reacts to price speed. Low = steady; high = quick changes.
Yearly Scaling (default: on): Makes values comparable across short or long charts. Turn off for raw numbers.
Mood Sensitivity (default: 1.0): How strict for calling high/low moods. Low = more shifts; high = only big ones.
Show Labels (default: on): Adds tiny "High Vol" or "Low Vol" tags when moods change. They point up or down from bars.
Background Fade (default: 80): How see-through the color fill is (0 = invisible, 100 = solid).
Bar Fade (default: 50): How much color blends into your candles or bars (0 = none, 100 = full).
How to Read and Use ItColor Shifts:Background and bars fade based on mood strength:Cyan shades mean calm markets (good for steady, back-and-forth trades).
Deep blue shades mean wild markets (watch for big moves or turns).
Smooth changes show volatility building or easing.
Labels:"High Vol" (deep blue, from below bar): Start of wild phase.
"Low Vol" (cyan, from above bar): Start of calm phase.
Only shows at changes to avoid clutter. Use for timing strategy tweaks.
Trading Ideas:Mood-Based Plays: In wild phases (deep blue), try chase-momentum or breakout trades since swings are bigger. In calm phases (cyan), stick to bounce-back or range trades.
Risk Tips: Cut trade sizes in wild times to handle bigger losses. Use calm times for longer holds with close stops.
Chart Time Tips: Turn on yearly scaling for matching short and long views. Test settings on past data—loosen for quick trades (more alerts), tighten for longer ones (fewer, stronger).
Mix with Others: Add trend lines or averages—buy in calm up-moves, sell in wild down-moves. Check with volume or key levels too.
Special Cases: In big news events, it reacts faster. On slow assets, it might overstate swings—ease the adjustment strength.
Limits and TipsIt looks back at past data, so it trails real-time action and can't predict ahead.
Results differ by stock or timeframe—test on history first.
Colors and tags are just visuals; set your own alerts if needed.
Follows TradingView rules: No win promises, for learning only. Open for sharing; share thoughts in forums.
With this, you can spot market energy and tweak your trades smarter. Start on practice charts.
USDJPY Fair Value Gap + Session Strategy🎯 Overview 
This strategy combines Fair Value Gaps (FVGs) with session-based order flow analysis, specifically optimized for USDJPY. It identifies price inefficiencies left behind by institutional order flow during high-volatility trading sessions, offering a modern alternative to traditional lagging indicators.
 🔬 What Are Fair Value Gaps? 
Fair Value Gaps represent areas where aggressive institutional buying or selling created "gaps" in the market structure:
Bullish FVG: Price moves up so aggressively that it leaves unfilled buy orders behind
Bearish FVG: Price moves down so quickly that it leaves unfilled sell orders behind
Research shows approximately 80% of FVGs get "filled" (price returns to the gap) within 20-60 bars, making them highly predictable trading zones.
(see the generated image above)
(see the generated image above)
FVG Detection Logic:
text
// Bullish FVG: Gap between high  and current low
bullishFVG = low > high  and high  > high 
// Bearish FVG: Gap between low  and current high
bearishFVG = high < low  and low  < low 
 🌏 Session-Based Trading 
Why Sessions Matter for USDJPY
(see the generated image above)
Tokyo Session (00:00-09:00 UTC)
Highest volatility during first hour (00:00-01:00 UTC)
Average movement: 51-60 pips
Best for breakout strategies
London/NY Overlap (13:00-16:00 UTC)
Maximum liquidity and institutional participation
Tightest spreads and most reliable FVG formations
Optimal for continuation trades
Monday Premium Effect
USDJPY moves 120+ pips on Mondays due to weekend positioning
Enhanced FVG formation during session opens
 📊 Strategy Components 
(see the generated image above)
1. Fair Value Gap Detection
Identifies bullish and bearish FVGs automatically
Age limit: FVGs expire after 20 bars to avoid stale setups
Size filter: Minimum gap size to filter out noise
2. Session Filtering
Tokyo Open focus: Trades during first hour of Asian session
London/NY Overlap: Captures high-liquidity institutional flows
Weekend gap strategy: Enhanced signals on Monday opens
3. Volume Confirmation
Requires 1.5x average volume spike
Confirms institutional participation
Reduces false signals
4. Trend Alignment
50 EMA filter ensures trades align with higher timeframe trend
Long trades above EMA, short trades below
Prevents costly counter-trend trades
5. Risk Management
2:1 Risk/Reward minimum ensures profitability with 40%+ win rate
Percentage-based stops adapt to USDJPY volatility (0.3% default)
Configurable position sizing
 🎯 Entry Conditions 
(see the generated image above)
Long Entry (BUY)
✅ Bullish FVG detected in previous bars
✅ Price returns to FVG zone during active trading session
✅ Volume spike above 1.5x average
✅ Price above 50 EMA (trend confirmation)
✅ Bullish candle closes within FVG zone
✅ Trading during Tokyo open OR London/NY overlap
Short Entry (SELL)
✅ Bearish FVG detected in previous bars
✅ Price returns to FVG zone during active trading session
✅ Volume spike above 1.5x average
✅ Price below 50 EMA (trend confirmation)
✅ Bearish candle closes within FVG zone
✅ Trading during Tokyo open OR London/NY overlap
 📈 Expected Performance 
 
 Backtesting Results (Based on Similar Strategies):
 Win Rate: 44-59% (profitable due to high R:R ratio)
 Average Winner: 60-90 pips during London/NY sessions
 Average Loser: 30-40 pips (tight stops at FVG boundaries)
 Risk/Reward: 2:1 minimum, often 3:1 during strong trends
 Best Performance: Monday Tokyo opens and Wednesday London/NY overlaps
 Why This Works for USDJPY:
 90% correlation with US-Japan bond yield spreads
 High volatility provides sufficient pip movement
 Heavy institutional/central bank participation creates clear FVGs
 Consistent volatility patterns across trading sessions
 
⚙️ Configurable Parameters
Session Settings:
Trade Tokyo Session (Enable/Disable)
Trade London/NY Overlap (Enable/Disable)
FVG Settings:
FVG Minimum Size (Filter small gaps)
Maximum FVG Age (20 bars default)
Show FVG Markers (Visual display)
Volume Settings:
Use Volume Filter (Enable/Disable)
Volume Multiplier (1.5x default)
Volume Average Period (20 bars)
Trend Settings:
Use Trend Filter (Enable/Disable)
Trend EMA Period (50 default)
Risk Management:
Risk/Reward Ratio (2.0 default)
Stop Loss Percentage (0.3% default)
🎨 Visual Indicators
🟡 Yellow Line: 50 EMA trend filter
🟢 Green Triangles: Long entry signals
🔴 Red Triangles: Short entry signals
🟢 Green Dots: Bullish FVG zones
🔴 Red Dots: Bearish FVG zones
🟦 Blue Background: Tokyo open session
🟧 Orange Background: London/NY overlap
📊 Recommended Settings
Optimal Timeframes:
Primary: 5-minute charts (scalping)
Secondary: 15-minute charts (swing trading)
Parameter Optimization:
Conservative: Stop Loss 0.2%, R:R 2:1, Volume 2.0x
Balanced: Stop Loss 0.3%, R:R 2:1, Volume 1.5x (default)
Aggressive: Stop Loss 0.4%, R:R 1.5:1, Volume 1.2x
Risk Management:
Maximum 1-2% of account per trade
Daily loss limit: Stop after 3-5 consecutive losses
Use fixed percentage position sizing
⚠️ Important Considerations
Avoid Trading During:
Major news events (BOJ interventions, NFP, FOMC)
Holiday periods with reduced liquidity
Low volatility Asian afternoon sessions
When US-Japan yield differential narrows sharply
Best Practices:
Limit to 2-3 trades per session maximum
Always respect the 50 EMA trend filter
Never risk more than planned per trade
Paper trade for 2-4 weeks before live implementation
Track performance by session and day of week
🚀 How to Use
 
 Add the script to your USDJPY chart
 Set timeframe to 5-minute or 15-minute
 Adjust parameters based on your risk tolerance
 Enable strategy alerts for automated notifications
 Wait for visual signals (triangles) to appear
 Enter trades according to your risk management rules
 
📚 Strategy Foundation
This strategy is based on:
Smart Money Concepts (SMC): Institutional order flow tracking
Market Microstructure: Understanding how FVGs form in electronic trading
Quantified Risk Management: Statistical edge through proper R:R ratios
Session Liquidity Patterns: Exploiting predictable volatility cycles
Advanced Speedometer Gauge [PhenLabs]Advanced Speedometer Gauge  
Version: PineScript™v6
 📌 Description 
The Advanced Speedometer Gauge is a revolutionary multi-metric visualization tool that consolidates 13 distinct trading indicators into a single, intuitive speedometer display. Instead of cluttering your workspace with multiple oscillators and panels, this gauge provides a unified interface where you can switch between different metrics while maintaining consistent visual interpretation.
Built on PineScript™ v6, the indicator transforms complex technical calculations into an easy-to-read semi-circular gauge with color-coded zones and a precision needle indicator. Each of the 13 available metrics has been carefully normalized to a 0-100 scale, ensuring that whether you’re analyzing RSI, volume trends, or volatility extremes, the visual interpretation remains consistent and intuitive.
The gauge is designed for traders who value efficiency and clarity. By consolidating multiple analytical perspectives into one compact display, you can quickly assess market conditions without the visual noise of traditional multi-indicator setups. All metrics are non-overlapping, meaning each provides unique insights into different aspects of market behavior.
 🚀 Points of Innovation 
 
  13 selectable metrics covering momentum, volume, volatility, trend, and statistical analysis, all accessible through a single dropdown menu
  Universal 0-100 normalization system that standardizes different indicator scales for consistent visual interpretation across all metrics
  Semi-circular gauge design with 21 arc segments providing smooth precision and clear visual feedback through color-coded zones
  Non-redundant metric selection ensuring each indicator provides unique market insights without analytical overlap
  Advanced metrics including MFI (volume-weighted momentum), CCI (statistical deviation), Volatility Rank (extended lookback), Trend Strength (ADX-style), Choppiness Index, Volume Trend, and Price Distance from MA
  Flexible positioning system with 5 chart locations, 3 size options, and fully customizable color schemes for optimal workspace integration
 
 🔧 Core Components 
 
   Metric Selection Engine:  Dropdown interface allowing instant switching between 13 different technical indicators, each with independent parameter controls
   Normalization System:  All metrics converted to 0-100 scale using indicator-specific algorithms that preserve the statistical significance of each measurement
   Semi-Circular Gauge:  Visual display using 21 arc segments arranged in curved formation with two-row thickness for enhanced visibility
   Color Zone System:  Three distinct zones (0-40 green, 40-70 yellow, 70-100 red) providing instant visual feedback on metric extremes
   Needle Indicator:  Dynamic pointer that positions across the gauge arc based on precise current metric value
   Table Implementation:  Professional table structure ensuring consistent positioning and rendering across different chart configurations
 
 🔥 Key Features 
 
   RSI (Relative Strength Index):  Classic momentum oscillator measuring overbought/oversold conditions with adjustable period length (default 14)
   Stochastic Oscillator:  Compares closing price to price range over specified period with smoothing, ideal for identifying momentum shifts
   MFI (Money Flow Index):  Volume-weighted RSI that combines price movement with volume to measure buying and selling pressure intensity
   CCI (Commodity Channel Index):  Measures statistical deviation from average price, normalized from typical -200 to +200 range to 0-100 scale
   Williams %R:  Alternative overbought/oversold indicator using high-low range analysis, inverted to match 0-100 scale conventions
   Volume %:  Current volume relative to moving average expressed as percentage, capped at 100 for extreme spikes
   Volume Trend:  Cumulative directional volume flow showing whether volume is flowing into up moves or down moves over specified period
   ATR Percentile:  Current Average True Range position within historical range using specified lookback period (default 100 bars)
   Volatility Rank:  Close-to-close volatility measured against extended historical range (default 252 days), differs from ATR in calculation method
   Momentum:  Rate of change calculation showing price movement speed, centered at 50 and normalized to 0-100 range
   Trend Strength:  ADX-style calculation using directional movement to quantify trend intensity regardless of direction
   Choppiness Index:  Measures market choppiness versus trending behavior, where high values indicate ranging markets and low values indicate strong trends
   Price Distance from MA:  Measures current price over-extension from moving average using standard deviation calculations
 
 🎨 Visualization 
 
   Semi-Circular Arc Display:  Curved gauge spanning from 0 (left) to 100 (right) with smooth progression and two-row thickness for visibility
   Color-Coded Zones:  Green zone (0-40) for low/oversold conditions, yellow zone (40-70) for neutral readings, red zone (70-100) for high/overbought conditions
   Needle Indicator:  Downward-pointing triangle (▼) positioned precisely at current metric value along the gauge arc
   Scale Markers:  Vertical line markers at 0, 25, 50, 75, and 100 positions with corresponding numerical labels below
   Title Display:  Merged cell showing “𓄀 PhenLabs” branding plus currently selected metric name in monospace font
   Large Value Display:  Current metric value shown with two decimal precision in large text directly below title
   Table Structure:  Professional table with customizable background color, text color, and transparency for minimal chart obstruction
 
 📖 Usage Guidelines 
 Metric Selection 
 
   Select Metric:  Default: RSI | Options: RSI, Stochastic, Volume %, ATR Percentile, Momentum, MFI (Money Flow), CCI (Commodity Channel), Williams %R, Volatility Rank, Trend Strength, Choppiness Index, Volume Trend, Price Distance | Choose the technical indicator you want to display on the gauge based on your current analytical needs
 
 RSI Settings 
 
   RSI Length:  Default: 14 | Range: 1+ | Controls the lookback period for RSI calculation, shorter periods increase sensitivity to recent price changes
 
 Stochastic Settings 
 
   Stochastic Length:  Default: 14 | Range: 1+ | Lookback period for stochastic calculation comparing close to high-low range
   Stochastic Smooth:  Default: 3 | Range: 1+ | Smoothing period applied to raw stochastic value to reduce noise and false signals
 
 Volume Settings 
 
   Volume MA Length:  Default: 20 | Range: 1+ | Moving average period used to calculate average volume for comparison with current volume
   Volume Trend Length:  Default: 20 | Range: 5+ | Period for calculating cumulative directional volume flow trend
 
 ATR and Volatility Settings 
 
   ATR Length:  Default: 14 | Range: 1+ | Period for Average True Range calculation used in ATR Percentile metric
   ATR Percentile Lookback:  Default: 100 | Range: 20+ | Historical range used to determine current ATR position as percentile
   Volatility Rank Lookback (Days):  Default: 252 | Range: 50+ | Extended lookback period for Volatility Rank metric using close-to-close volatility
 
 Momentum and Trend Settings 
 
   Momentum Length:  Default: 10 | Range: 1+ | Lookback period for rate of change calculation in Momentum metric
   Trend Strength Length:  Default: 20 | Range: 5+ | Period for directional movement calculations in ADX-style Trend Strength metric
 
 Advanced Metric Settings 
 
   MFI Length:  Default: 14 | Range: 1+ | Lookback period for Money Flow Index calculation combining price and volume
   CCI Length:  Default: 20 | Range: 1+ | Period for Commodity Channel Index statistical deviation calculation
   Williams %R Length:  Default: 14 | Range: 1+ | Lookback period for Williams %R high-low range analysis
   Choppiness Index Length:  Default: 14 | Range: 5+ | Period for calculating market choppiness versus trending behavior
   Price Distance MA Length:  Default: 50 | Range: 10+ | Moving average period used for Price Distance standard deviation calculation
 
 Visual Customization 
 
   Position:  Default: Top Right | Options: Top Left, Top Right, Bottom Left, Bottom Right, Middle Right | Controls gauge placement on chart for optimal workspace organization
   Size:  Default: Normal | Options: Small, Normal, Large | Adjusts overall gauge dimensions and text size for different monitor resolutions and preferences
   Low Zone Color (0-40):  Default: Green (#00FF00) | Customize color for low/oversold zone of gauge arc
   Medium Zone Color (40-70):  Default: Yellow (#FFFF00) | Customize color for neutral/medium zone of gauge arc
   High Zone Color (70-100):  Default: Red (#FF0000) | Customize color for high/overbought zone of gauge arc
   Background Color:  Default: Semi-transparent dark gray | Customize gauge background for contrast and chart integration
   Text Color:  Default: White (#FFFFFF) | Customize all text elements including title, value, and scale labels
 
 ✅ Best Use Cases 
 
  Quick visual assessment of market conditions when you need instant feedback on whether an asset is in extreme territory across multiple analytical dimensions
  Workspace organization for traders who monitor multiple indicators but want to reduce chart clutter and visual complexity
  Metric comparison by switching between different indicators while maintaining consistent visual interpretation through the 0-100 normalization
  Overbought/oversold identification using RSI, Stochastic, Williams %R, or MFI depending on whether you prefer price-only or volume-weighted analysis
  Volume analysis through Volume %, Volume Trend, or MFI to confirm price movements with corresponding volume characteristics
  Volatility monitoring using ATR Percentile or Volatility Rank to identify expansion/contraction cycles and adjust position sizing
  Trend vs range identification by comparing Trend Strength (high values = trending) against Choppiness Index (high values = ranging)
  Statistical over-extension detection using CCI or Price Distance to identify when price has deviated significantly from normal behavior
  Multi-timeframe analysis by duplicating the gauge on different timeframe charts to compare metric readings across time horizons
  Educational purposes for new traders learning to interpret technical indicators through consistent visual representation
 
 ⚠️ Limitations 
 
  The gauge displays only one metric at a time, requiring manual switching to compare different indicators rather than simultaneous multi-metric viewing
  The 0-100 normalization, while providing consistency, may obscure the raw values and specific nuances of each underlying indicator
  Table-based visualization cannot be exported or saved as an image separately from the full chart screenshot
  Optimal parameter settings vary by asset type, timeframe, and market conditions, requiring user experimentation for best results
 
 💡 What Makes This Unique 
 
   Unified Multi-Metric Interface:  The only gauge-style indicator offering 13 distinct metrics through a single interface, eliminating the need for multiple oscillator panels
   Non-Overlapping Analytics:  Each metric provides genuinely unique insights—MFI combines volume with price, CCI measures statistical deviation, Volatility Rank uses extended lookback, Trend Strength quantifies directional movement, and Choppiness Index measures ranging behavior
   Universal Normalization System:  All metrics standardized to 0-100 scale using indicator-appropriate algorithms that preserve statistical meaning while enabling consistent visual interpretation
   Professional Visual Design:  Semi-circular gauge with 21 arc segments, precision needle positioning, color-coded zones, and clean table implementation that maintains clarity across all chart configurations
   Extensive Customization:  Independent parameter controls for each metric, five position options, three size presets, and full color customization for seamless workspace integration
 
 🔬 How It Works 
 1. Metric Calculation Phase: 
 
  All 13 metrics are calculated simultaneously on every bar using their respective algorithms with user-defined parameters
  Each metric applies its own specific calculation method—RSI uses average gains vs losses, Stochastic compares close to high-low range, MFI incorporates typical price and volume, CCI measures deviation from statistical mean, ATR calculates true range, directional indicators measure up/down movement, and statistical metrics analyze price relationships
 
 2. Normalization Process: 
 
  Each calculated metric is converted to a standardized 0-100 scale using indicator-appropriate transformations
  Some metrics are naturally 0-100 (RSI, Stochastic, MFI, Williams %R), while others require scaling—CCI transforms from ±200 range, Momentum centers around 50, Volume ratio caps at 2x for 100, ATR and Volatility Rank calculate percentile positions, and Price Distance scales by standard deviations
 
 3. Gauge Rendering: 
 
  The selected metric’s normalized value determines the needle position across 21 arc segments spanning 0-100
  Each arc segment receives its color based on position—segments 0-8 are green zone, segments 9-14 are yellow zone, segments 15-20 are red zone
  The needle indicator (▼) appears in row 5 at the column corresponding to the current metric value, providing precise visual feedback
 
 4. Table Construction: 
 
  The gauge uses TradingView’s table system with merged cells for title and value display, ensuring consistent positioning regardless of chart configuration
  Rows are allocated as follows: Row 0 merged for title, Row 1 merged for large value display, Row 2 for spacing, Rows 3-4 for the semi-circular arc with curved shaping, Row 5 for needle indicator, Row 6 for scale markers, Row 7 for numerical labels at 0/25/50/75/100
  All visual elements update on every bar when barstate.islast is true, ensuring real-time accuracy without performance impact
 
 💡 Note: 
This indicator is designed for visual analysis and market condition assessment, not as a standalone trading system. For best results, combine gauge readings with price action analysis, support and resistance levels, and broader market context. Parameter optimization is recommended based on your specific trading timeframe and asset class. The gauge works on all timeframes but may require different parameter settings for intraday versus daily/weekly analysis. Consider using multiple instances of the gauge set to different metrics for comprehensive market analysis without switching between settings.
T3 ATR [DCAUT]█ T3 ATR  
 📊 ORIGINALITY & INNOVATION 
The T3 ATR indicator represents an important enhancement to the traditional Average True Range (ATR) indicator by incorporating the T3 (Tilson Triple Exponential Moving Average) smoothing algorithm. While standard ATR uses fixed RMA (Running Moving Average) smoothing, T3 ATR introduces a configurable volume factor parameter that allows traders to adjust the smoothing characteristics from highly responsive to heavily smoothed output.
This innovation addresses a fundamental limitation of traditional ATR: the inability to adapt smoothing behavior without changing the calculation period. With T3 ATR, traders can maintain a consistent ATR period while adjusting the responsiveness through the volume factor, making the indicator adaptable to different trading styles, market conditions, and timeframes through a single unified implementation.
The T3 algorithm's triple exponential smoothing with volume factor control provides improved signal quality by reducing noise while maintaining better responsiveness compared to traditional smoothing methods. This makes T3 ATR particularly valuable for traders who need to adapt their volatility measurement approach to varying market conditions without switching between multiple indicator configurations.
 📐 MATHEMATICAL FOUNDATION 
The T3 ATR calculation process involves two distinct stages:
 Stage 1: True Range Calculation 
The True Range (TR) is calculated using the standard formula:
 
 TR = max(high - low, |high - close |, |low - close |)
 
This captures the greatest of the current bar's range, the gap from the previous close to the current high, or the gap from the previous close to the current low, providing a comprehensive measure of price movement that accounts for gaps and limit moves.
 Stage 2: T3 Smoothing Application 
The True Range values are then smoothed using the T3 algorithm, which applies six exponential moving averages in succession:
 
 First Layer: e1 = EMA(TR, period), e2 = EMA(e1, period)
 Second Layer: e3 = EMA(e2, period), e4 = EMA(e3, period)
 Third Layer: e5 = EMA(e4, period), e6 = EMA(e5, period)
 Final Calculation: T3 = c1×e6 + c2×e5 + c3×e4 + c4×e3
 
The coefficients (c1, c2, c3, c4) are derived from the volume factor (VF) parameter:
 
 a = VF / 2
 c1 = -a³
 c2 = 3a² + 3a³
 c3 = -6a² - 3a - 3a³
 c4 = 1 + 3a + a³ + 3a²
 
The volume factor parameter (0.0 to 1.0) controls the weighting of these coefficients, directly affecting the balance between responsiveness and smoothness:
 
 Lower VF values (approaching 0.0): Coefficients favor recent data, resulting in faster response to volatility changes with minimal lag but potentially more noise
 Higher VF values (approaching 1.0): Coefficients distribute weight more evenly across the smoothing layers, producing smoother output with reduced noise but slightly increased lag
 
 📊 COMPREHENSIVE SIGNAL ANALYSIS 
 Volatility Level Interpretation: 
 
 High Absolute Values: Indicate strong price movements and elevated market activity, suggesting larger position risks and wider stop-loss requirements, often associated with trending markets or significant news events
 Low Absolute Values: Indicate subdued price movements and quiet market conditions, suggesting smaller position risks and tighter stop-loss opportunities, often associated with consolidation phases or low-volume periods
 Rapid Increases: Sharp spikes in T3 ATR often signal the beginning of significant price moves or market regime changes, providing early warning of increased trading risk
 Sustained High Levels: Extended periods of elevated T3 ATR indicate sustained trending conditions with persistent volatility, suitable for trend-following strategies
 Sustained Low Levels: Extended periods of low T3 ATR indicate range-bound conditions with suppressed volatility, suitable for mean-reversion strategies
 
 Volume Factor Impact on Signals: 
 
 Low VF Settings (0.0-0.3): Produce responsive signals that quickly capture volatility changes, suitable for short-term trading but may generate more frequent color changes during minor fluctuations
 Medium VF Settings (0.4-0.7): Provide balanced signal quality with moderate responsiveness, filtering out minor noise while capturing significant volatility changes, suitable for swing trading
 High VF Settings (0.8-1.0): Generate smooth, stable signals that filter out most noise and focus on major volatility trends, suitable for position trading and long-term analysis
 
 🎯 STRATEGIC APPLICATIONS 
 Position Sizing Strategy: 
 
 Determine your risk per trade (e.g., 1% of account capital - adjust based on your risk tolerance and experience)
 Decide your stop-loss distance multiplier (e.g., 2.0x T3 ATR - this varies by market and strategy, test different values)
 Calculate stop-loss distance: Stop Distance = Multiplier × Current T3 ATR
 Calculate position size: Position Size = (Account × Risk %) / Stop Distance
 Example: $10,000 account, 1% risk, T3 ATR = 50 points, 2x multiplier → Position Size = ($10,000 × 0.01) / (2 × 50) = $100 / 100 points = 1 unit per point
 Important: The ATR multiplier (1.5x - 3.0x) should be determined through backtesting for your specific instrument and strategy - using inappropriate multipliers may result in stops that are too tight (frequent stop-outs) or too wide (excessive losses)
 Adjust the volume factor to match your trading style: lower VF for responsive stop distances in short-term trading, higher VF for stable stop distances in position trading
 
 Dynamic Stop-Loss Placement: 
 
 Determine your risk tolerance multiplier (typically 1.5x to 3.0x T3 ATR)
 For long positions: Set stop-loss at entry price minus (multiplier × current T3 ATR value)
 For short positions: Set stop-loss at entry price plus (multiplier × current T3 ATR value)
 Trail stop-losses by recalculating based on current T3 ATR as the trade progresses
 Adjust the volume factor based on desired stop-loss stability: higher VF for less frequent adjustments, lower VF for more adaptive stops
 
 Market Regime Identification: 
 
 Calculate a reference volatility level using a longer-period moving average of T3 ATR (e.g., 50-period SMA)
 High Volatility Regime: Current T3 ATR significantly above reference (e.g., 120%+) - favor trend-following strategies, breakout trades, and wider targets
 Normal Volatility Regime: Current T3 ATR near reference (e.g., 80-120%) - employ standard trading strategies appropriate for prevailing market structure
 Low Volatility Regime: Current T3 ATR significantly below reference (e.g., <80%) - favor mean-reversion strategies, range trading, and prepare for potential volatility expansion
 Monitor T3 ATR trend direction and compare current values to recent history to identify regime transitions early
 
 Risk Management Implementation: 
 
 Establish your maximum portfolio heat (total risk across all positions, typically 2-6% of capital)
 For each position: Calculate position size using the formula Position Size = (Account × Individual Risk %) / (ATR Multiplier × Current T3 ATR)
 When T3 ATR increases: Position sizes automatically decrease (same risk %, larger stop distance = smaller position)
 When T3 ATR decreases: Position sizes automatically increase (same risk %, smaller stop distance = larger position)
 This approach maintains constant dollar risk per trade regardless of market volatility changes
 Use consistent volume factor settings across all positions to ensure uniform risk measurement
 
 📋 DETAILED PARAMETER CONFIGURATION 
 ATR Length Parameter: 
Default Setting: 14 periods
 
 This is the standard ATR calculation period established by Welles Wilder, providing balanced volatility measurement that captures both short-term fluctuations and medium-term trends across most markets and timeframes
 
Selection Principles:
 
 Shorter periods increase sensitivity to recent volatility changes and respond faster to market shifts, but may produce less stable readings
 Longer periods emphasize sustained volatility trends and filter out short-term noise, but respond more slowly to genuine regime changes
 The optimal period depends on your holding time, trading frequency, and the typical volatility cycle of your instrument
 Consider the timeframe you trade: Intraday traders typically use shorter periods, swing traders use intermediate periods, position traders use longer periods
 
Practical Approach:
 
 Start with the default 14 periods and observe how well it captures volatility patterns relevant to your trading decisions
 If ATR seems too reactive to minor price movements: Increase the period until volatility readings better reflect meaningful market changes
 If ATR lags behind obvious volatility shifts that affect your trades: Decrease the period for faster response
 Match the period roughly to your typical holding time - if you hold positions for N bars, consider ATR periods in a similar range
 Test different periods using historical data for your specific instrument and strategy before committing to live trading
 
 T3 Volume Factor Parameter: 
Default Setting: 0.7
 
 This setting provides a reasonable balance between responsiveness and smoothness for most market conditions and trading styles
 
Understanding the Volume Factor:
 
 Lower values (closer to 0.0) reduce smoothing, allowing T3 ATR to respond more quickly to volatility changes but with less noise filtering
 Higher values (closer to 1.0) increase smoothing, producing more stable readings that focus on sustained volatility trends but respond more slowly
 The trade-off is between immediacy and stability - there is no universally optimal setting
 
Selection Principles:
 
 Match to your decision speed: If you need to react quickly to volatility changes for entries/exits, use lower VF; if you're making longer-term risk assessments, use higher VF
 Match to market character: Noisier, choppier markets may benefit from higher VF for clearer signals; cleaner trending markets may work well with lower VF for faster response
 Match to your preference: Some traders prefer responsive indicators even with occasional false signals, others prefer stable indicators even with some delay
 
Practical Adjustment Guidelines:
 
 Start with default 0.7 and observe how T3 ATR behavior aligns with your trading needs over multiple sessions
 If readings seem too unstable or noisy for your decisions: Try increasing VF toward 0.9-1.0 for heavier smoothing
 If the indicator lags too much behind volatility changes you care about: Try decreasing VF toward 0.3-0.5 for faster response
 Make meaningful adjustments (0.2-0.3 changes) rather than small increments - subtle differences are often imperceptible in practice
 Test adjustments in simulation or paper trading before applying to live positions
 
 📈 PERFORMANCE ANALYSIS & COMPETITIVE ADVANTAGES 
 Responsiveness Characteristics: 
The T3 smoothing algorithm provides improved responsiveness compared to traditional RMA smoothing used in standard ATR. The triple exponential design with volume factor control allows the indicator to respond more quickly to genuine volatility changes while maintaining the ability to filter noise through appropriate VF settings. This results in earlier detection of volatility regime changes compared to standard ATR, particularly valuable for risk management and position sizing adjustments.
 Signal Stability: 
Unlike simple smoothing methods that may produce erratic signals during transitional periods, T3 ATR's multi-layer exponential smoothing provides more stable signal progression. The volume factor parameter allows traders to tune signal stability to their preference, with higher VF settings producing remarkably smooth volatility profiles that help avoid overreaction to temporary market fluctuations.
 Comparison with Standard ATR: 
 
 Adaptability: T3 ATR allows adjustment of smoothing characteristics through the volume factor without changing the ATR period, whereas standard ATR requires changing the period length to alter responsiveness, potentially affecting the fundamental volatility measurement
 Lag Reduction: At lower volume factor settings, T3 ATR responds more quickly to volatility changes than standard ATR with equivalent periods, providing earlier signals for risk management adjustments
 Noise Filtering: At higher volume factor settings, T3 ATR provides superior noise filtering compared to standard ATR, producing cleaner signals for long-term analysis without sacrificing volatility measurement accuracy
 Flexibility: A single T3 ATR configuration can serve multiple trading styles by adjusting only the volume factor, while standard ATR typically requires multiple instances with different periods for different trading applications
 
 Suitable Use Cases: 
T3 ATR is well-suited for the following scenarios:
 
 Dynamic Risk Management: When position sizing and stop-loss placement need to adapt quickly to changing volatility conditions
 Multi-Style Trading: When a single volatility indicator must serve different trading approaches (day trading, swing trading, position trading)
 Volatile Markets: When standard ATR produces too many false volatility signals during choppy conditions
 Systematic Trading: When algorithmic systems require a single, configurable volatility input that can be optimized for different instruments
 Market Regime Analysis: When clear identification of volatility expansion and contraction phases is critical for strategy selection
 
 Known Limitations: 
Like all technical indicators, T3 ATR has limitations that users should understand:
 
 Historical Nature: T3 ATR is calculated from historical price data and cannot predict future volatility with certainty
 Smoothing Trade-offs: The volume factor setting involves a trade-off between responsiveness and smoothness - no single setting is optimal for all market conditions
 Extreme Events: During unprecedented market events or gaps, T3 ATR may not immediately reflect the full scope of volatility until sufficient data is processed
 Relative Measurement: T3 ATR values are most meaningful in relative context (compared to recent history) rather than as absolute thresholds
 Market Context Required: T3 ATR measures volatility magnitude but does not indicate price direction or trend quality - it should be used in conjunction with directional analysis
 
 Performance Expectations: 
T3 ATR is designed to help traders measure and adapt to changing market volatility conditions. When properly configured and applied:
 
 It can help reduce position risk during volatile periods through appropriate position sizing
 It can help identify optimal times for more aggressive position sizing during stable periods
 It can improve stop-loss placement by adapting to current market conditions
 It can assist in strategy selection by identifying volatility regimes
 
However, volatility measurement alone does not guarantee profitable trading. T3 ATR should be integrated into a comprehensive trading approach that includes directional analysis, proper risk management, and sound trading psychology.
 USAGE NOTES 
This indicator is designed for technical analysis and educational purposes. T3 ATR provides adaptive volatility measurement but has limitations and should not be used as the sole basis for trading decisions. The indicator measures historical volatility patterns, and past volatility characteristics do not guarantee future volatility behavior. Market conditions can change rapidly, and extreme events may produce volatility readings that fall outside historical norms.
Traders should combine T3 ATR with directional analysis tools, support/resistance analysis, and other technical indicators to form a complete trading strategy. Proper backtesting and forward testing with appropriate risk management is essential before applying T3 ATR-based strategies to live trading. The volume factor parameter should be optimized for specific instruments and trading styles through careful testing rather than assuming default settings are optimal for all applications.
Keltner Channel Enhanced [DCAUT]█ Keltner Channel Enhanced  
 📊 ORIGINALITY & INNOVATION 
The Keltner Channel Enhanced represents an important advancement over standard Keltner Channel implementations by introducing dual flexibility in moving average selection for both the middle band and ATR calculation. While traditional Keltner Channels typically use EMA for the middle band and RMA (Wilder's smoothing) for ATR, this enhanced version provides access to 25+ moving average algorithms for both components, enabling traders to fine-tune the indicator's behavior to match specific market characteristics and trading approaches.
 Key Advancements: 
 
 Dual MA Algorithm Flexibility: Independent selection of moving average types for middle band (25+ options) and ATR smoothing (25+ options), allowing optimization of both trend identification and volatility measurement separately
 Enhanced Trend Sensitivity: Ability to use faster algorithms (HMA, T3) for middle band while maintaining stable volatility measurement with traditional ATR smoothing, or vice versa for different trading strategies
 Adaptive Volatility Measurement: Choice of ATR smoothing algorithm affects channel responsiveness to volatility changes, from highly reactive (SMA, EMA) to smoothly adaptive (RMA, TEMA)
 Comprehensive Alert System: Five distinct alert conditions covering breakouts, trend changes, and volatility expansion, enabling automated monitoring without constant chart observation
 Multi-Timeframe Compatibility: Works effectively across all timeframes from intraday scalping to long-term position trading, with independent optimization of trend and volatility components
 
This implementation addresses key limitations of standard Keltner Channels: fixed EMA/RMA combination may not suit all market conditions or trading styles. By decoupling the trend component from volatility measurement and allowing independent algorithm selection, traders can create highly customized configurations for specific instruments and market phases.
 📐 MATHEMATICAL FOUNDATION 
Keltner Channel Enhanced uses a three-component calculation system that combines a flexible moving average middle band with ATR-based (Average True Range) upper and lower channels, creating volatility-adjusted trend-following bands.
 Core Calculation Process: 
 1. Middle Band (Basis) Calculation: 
The basis line is calculated using the selected moving average algorithm applied to the price source over the specified period:
 
basis = ma(source, length, maType)
 
Supported algorithms include EMA (standard choice, trend-biased), SMA (balanced and symmetric), HMA (reduced lag), WMA, VWMA, TEMA, T3, KAMA, and 17+ others.
 2. Average True Range (ATR) Calculation: 
ATR measures market volatility by calculating the average of true ranges over the specified period:
 
trueRange = max(high - low, abs(high - close ), abs(low - close ))
atrValue = ma(trueRange, atrLength, atrMaType)
 
ATR smoothing algorithm significantly affects channel behavior, with options including RMA (standard, very smooth), SMA (moderate smoothness), EMA (fast adaptation), TEMA (smooth yet responsive), and others.
 3. Channel Calculation: 
Upper and lower channels are positioned at specified multiples of ATR from the basis:
 
upperChannel = basis + (multiplier × atrValue)
lowerChannel = basis - (multiplier × atrValue)
 
Standard multiplier is 2.0, providing channels that dynamically adjust width based on market volatility.
 Keltner Channel vs. Bollinger Bands - Key Differences: 
While both indicators create volatility-based channels, they use fundamentally different volatility measures:
 Keltner Channel (ATR-based): 
 
 Uses Average True Range to measure actual price movement volatility
 Incorporates gaps and limit moves through true range calculation
 More stable in trending markets, less prone to extreme compression
 Better reflects intraday volatility and trading range
 Typically fewer band touches, making touches more significant
 More suitable for trend-following strategies
 
 Bollinger Bands (Standard Deviation-based): 
 
 Uses statistical standard deviation to measure price dispersion
 Based on closing prices only, doesn't account for intraday range
 Can compress significantly during consolidation (squeeze patterns)
 More touches in ranging markets
 Better suited for mean-reversion strategies
 Provides statistical probability framework (95% within 2 standard deviations)
 
 Algorithm Combination Effects: 
The interaction between middle band MA type and ATR MA type creates different indicator characteristics:
 
 Trend-Focused Configuration (Fast MA + Slow ATR): Middle band uses HMA/EMA/T3, ATR uses RMA/TEMA, quick trend changes with stable channel width, suitable for trend-following
 Volatility-Focused Configuration (Slow MA + Fast ATR): Middle band uses SMA/WMA, ATR uses EMA/SMA, stable trend with dynamic channel width, suitable for volatility trading
 Balanced Configuration (Standard EMA/RMA): Classic Keltner Channel behavior, time-tested combination, suitable for general-purpose trend following
 Adaptive Configuration (KAMA + KAMA): Self-adjusting indicator responding to efficiency ratio, suitable for markets with varying trend strength and volatility regimes
 
 📊 COMPREHENSIVE SIGNAL ANALYSIS 
Keltner Channel Enhanced provides multiple signal categories optimized for trend-following and breakout strategies.
 Channel Position Signals: 
 Upper Channel Interaction: 
 
 Price Touching Upper Channel: Strong bullish momentum, price moving more than typical volatility range suggests, potential continuation signal in established uptrends
 Price Breaking Above Upper Channel: Exceptional strength, price exceeding normal volatility expectations, consider adding to long positions or tightening trailing stops
 Price Riding Upper Channel: Sustained strong uptrend, characteristic of powerful bull moves, stay with trend and avoid premature profit-taking
 Price Rejection at Upper Channel: Momentum exhaustion signal, consider profit-taking on longs or waiting for pullback to middle band for reentry
 
 Lower Channel Interaction: 
 
 Price Touching Lower Channel: Strong bearish momentum, price moving more than typical volatility range suggests, potential continuation signal in established downtrends
 Price Breaking Below Lower Channel: Exceptional weakness, price exceeding normal volatility expectations, consider adding to short positions or protecting against further downside
 Price Riding Lower Channel: Sustained strong downtrend, characteristic of powerful bear moves, stay with trend and avoid premature covering
 Price Rejection at Lower Channel: Momentum exhaustion signal, consider covering shorts or waiting for bounce to middle band for reentry
 
 Middle Band (Basis) Signals: 
 Trend Direction Confirmation: 
 
 Price Above Basis: Bullish trend bias, middle band acts as dynamic support in uptrends, consider long positions or holding existing longs
 Price Below Basis: Bearish trend bias, middle band acts as dynamic resistance in downtrends, consider short positions or avoiding longs
 Price Crossing Above Basis: Potential trend change from bearish to bullish, early signal to establish long positions
 Price Crossing Below Basis: Potential trend change from bullish to bearish, early signal to establish short positions or exit longs
 
 Pullback Trading Strategy: 
 
 Uptrend Pullback: Price pulls back from upper channel to middle band, finds support, and resumes upward, ideal long entry point
 Downtrend Bounce: Price bounces from lower channel to middle band, meets resistance, and resumes downward, ideal short entry point
 Basis Test: Strong trends often show price respecting the middle band as support/resistance on pullbacks
 Failed Test: Price breaking through middle band against trend direction signals potential reversal
 
 Volatility-Based Signals: 
 Narrow Channels (Low Volatility): 
 
 Consolidation Phase: Channels contract during periods of reduced volatility and directionless price action
 Breakout Preparation: Narrow channels often precede significant directional moves as volatility cycles
 Trading Approach: Reduce position sizes, wait for breakout confirmation, avoid range-bound strategies within channels
 Breakout Direction: Monitor for price breaking decisively outside channel range with expanding width
 
 Wide Channels (High Volatility): 
 
 Trending Phase: Channels expand during strong directional moves and increased volatility
 Momentum Confirmation: Wide channels confirm genuine trend with substantial volatility backing
 Trading Approach: Trend-following strategies excel, wider stops necessary, mean-reversion strategies risky
 Exhaustion Signs: Extreme channel width (historical highs) may signal approaching consolidation or reversal
 
 Advanced Pattern Recognition: 
 Channel Walking Pattern: 
 
 Upper Channel Walk: Price consistently touches or exceeds upper channel while staying above basis, very strong uptrend signal, hold longs aggressively
 Lower Channel Walk: Price consistently touches or exceeds lower channel while staying below basis, very strong downtrend signal, hold shorts aggressively
 Basis Support/Resistance: During channel walks, price typically uses middle band as support/resistance on minor pullbacks
 Pattern Break: Price crossing basis during channel walk signals potential trend exhaustion
 
 Squeeze and Release Pattern: 
 
 Squeeze Phase: Channels narrow significantly, price consolidates near middle band, volatility contracts
 Direction Clues: Watch for price positioning relative to basis during squeeze (above = bullish bias, below = bearish bias)
 Release Trigger: Price breaking outside narrow channel range with expanding width confirms breakout
 Follow-Through: Measure squeeze height and project from breakout point for initial profit targets
 
 Channel Expansion Pattern: 
 
 Breakout Confirmation: Rapid channel widening confirms volatility increase and genuine trend establishment
 Entry Timing: Enter positions early in expansion phase before trend becomes overextended
 Risk Management: Use channel width to size stops appropriately, wider channels require wider stops
 
 Basis Bounce Pattern: 
 
 Clean Bounce: Price touches middle band and immediately reverses, confirms trend strength and entry opportunity
 Multiple Bounces: Repeated basis bounces indicate strong, sustainable trend
 Bounce Failure: Price penetrating basis signals weakening trend and potential reversal
 
 Divergence Analysis: 
 
 Price/Channel Divergence: Price makes new high/low while staying within channel (not reaching outer band), suggests momentum weakening
 Width/Price Divergence: Price breaks to new extremes but channel width contracts, suggests move lacks conviction
 Reversal Signal: Divergences often precede trend reversals or significant consolidation periods
 
 Multi-Timeframe Analysis: 
Keltner Channels work particularly well in multi-timeframe trend-following approaches:
 Three-Timeframe Alignment: 
 
 Higher Timeframe (Weekly/Daily): Identify major trend direction, note price position relative to basis and channels
 Intermediate Timeframe (Daily/4H): Identify pullback opportunities within higher timeframe trend
 Lower Timeframe (4H/1H): Time precise entries when price touches middle band or lower channel (in uptrends) with rejection
 
 Optimal Entry Conditions: 
 
 Best Long Entries: Higher timeframe in uptrend (price above basis), intermediate timeframe pulls back to basis, lower timeframe shows rejection at middle band or lower channel
 Best Short Entries: Higher timeframe in downtrend (price below basis), intermediate timeframe bounces to basis, lower timeframe shows rejection at middle band or upper channel
 Risk Management: Use higher timeframe channel width to set position sizing, stops below/above higher timeframe channels
 
 🎯 STRATEGIC APPLICATIONS 
Keltner Channel Enhanced excels in trend-following and breakout strategies across different market conditions.
 Trend Following Strategy: 
 Setup Requirements: 
 
 Identify established trend with price consistently on one side of basis line
 Wait for pullback to middle band (basis) or brief penetration through it
 Confirm trend resumption with price rejection at basis and move back toward outer channel
 Enter in trend direction with stop beyond basis line
 
 Entry Rules: 
 Uptrend Entry: 
 
 Price pulls back from upper channel to middle band, shows support at basis (bullish candlestick, momentum divergence)
 Enter long on rejection/bounce from basis with stop 1-2 ATR below basis
 Aggressive: Enter on first touch; Conservative: Wait for confirmation candle
 
 Downtrend Entry: 
 
 Price bounces from lower channel to middle band, shows resistance at basis (bearish candlestick, momentum divergence)
 Enter short on rejection/reversal from basis with stop 1-2 ATR above basis
 Aggressive: Enter on first touch; Conservative: Wait for confirmation candle
 
 Trend Management: 
 
 Trailing Stop: Use basis line as dynamic trailing stop, exit if price closes beyond basis against position
 Profit Taking: Take partial profits at opposite channel, move stops to basis
 Position Additions: Add to winners on subsequent basis bounces if trend intact
 
 Breakout Strategy: 
 Setup Requirements: 
 
 Identify consolidation period with contracting channel width
 Monitor price action near middle band with reduced volatility
 Wait for decisive breakout beyond channel range with expanding width
 Enter in breakout direction after confirmation
 
 Breakout Confirmation: 
 
 Price breaks clearly outside channel (upper for longs, lower for shorts), channel width begins expanding from contracted state
 Volume increases significantly on breakout (if using volume analysis)
 Price sustains outside channel for multiple bars without immediate reversal
 
 Entry Approaches: 
 
 Aggressive: Enter on initial break with stop at opposite channel or basis, use smaller position size
 Conservative: Wait for pullback to broken channel level, enter on rejection and resumption, tighter stop
 
 Volatility-Based Position Sizing: 
Adjust position sizing based on channel width (ATR-based volatility):
 
 Wide Channels (High ATR): Reduce position size as stops must be wider, calculate position size using ATR-based risk calculation: Risk / (Stop Distance in ATR × ATR Value)
 Narrow Channels (Low ATR): Increase position size as stops can be tighter, be cautious of impending volatility expansion
 ATR-Based Risk Management: Use ATR-based risk calculations, position size = 0.01 × Capital / (2 × ATR), use multiples of ATR (1-2 ATR) for adaptive stops
 
 Algorithm Selection Guidelines: 
Different market conditions benefit from different algorithm combinations:
 
 Strong Trending Markets: Middle band use EMA or HMA, ATR use RMA, capture trends quickly while maintaining stable channel width
 Choppy/Ranging Markets: Middle band use SMA or WMA, ATR use SMA or WMA, avoid false trend signals while identifying genuine reversals
 Volatile Markets: Middle band and ATR both use KAMA or FRAMA, self-adjusting to changing market conditions reduces manual optimization
 Breakout Trading: Middle band use SMA, ATR use EMA or SMA, stable trend with dynamic channels highlights volatility expansion early
 Scalping/Day Trading: Middle band use HMA or T3, ATR use EMA or TEMA, both components respond quickly
 Position Trading: Middle band use EMA/TEMA/T3, ATR use RMA or TEMA, filter out noise for long-term trend-following
 
 📋 DETAILED PARAMETER CONFIGURATION 
Understanding and optimizing parameters is essential for adapting Keltner Channel Enhanced to specific trading approaches.
 Source Parameter: 
 
 Close (Most Common): Uses closing price, reflects daily settlement, best for end-of-day analysis and position trading, standard choice
 HL2 (Median Price): Smooths out closing bias, better represents full daily range in volatile markets, good for swing trading
 HLC3 (Typical Price): Gives more weight to close while including full range, popular for intraday applications, slightly more responsive than HL2
 OHLC4 (Average Price): Most comprehensive price representation, smoothest option, good for gap-prone markets or highly volatile instruments
 
 Length Parameter: 
Controls the lookback period for middle band (basis) calculation:
 
 Short Periods (10-15): Very responsive to price changes, suitable for day trading and scalping, higher false signal rate
 Standard Period (20 - Default): Represents approximately one month of trading, good balance between responsiveness and stability, suitable for swing and position trading
 Medium Periods (30-50): Smoother trend identification, fewer false signals, better for position trading and longer holding periods
 Long Periods (50+): Very smooth, identifies major trends only, minimal false signals but significant lag, suitable for long-term investment
 
 Optimization by Timeframe:  1-15 minute charts use 10-20 period, 30-60 minute charts use 20-30 period, 4-hour to daily charts use 20-40 period, weekly charts use 20-30 weeks.
 ATR Length Parameter: 
Controls the lookback period for Average True Range calculation, affecting channel width:
 
 Short ATR Periods (5-10): Very responsive to recent volatility changes, standard is 10 (Keltner's original specification), may be too reactive in whipsaw conditions
 Standard ATR Period (10 - Default): Chester Keltner's original specification, good balance between responsiveness and stability, most widely used
 Medium ATR Periods (14-20): Smoother channel width, ATR 14 aligns with Wilder's original ATR specification, good for position trading
 Long ATR Periods (20+): Very smooth channel width, suitable for long-term trend-following
 
 Length vs. ATR Length Relationship:  Equal values (20/20) provide balanced responsiveness, longer ATR (20/14) gives more stable channel width, shorter ATR (20/10) is standard configuration, much shorter ATR (20/5) creates very dynamic channels.
 Multiplier Parameter: 
Controls channel width by setting ATR multiples:
 
 Lower Values (1.0-1.5): Tighter channels with frequent price touches, more trading signals, higher false signal rate, better for range-bound and mean-reversion strategies
 Standard Value (2.0 - Default): Chester Keltner's recommended setting, good balance between signal frequency and reliability, suitable for both trending and ranging strategies
 Higher Values (2.5-3.0): Wider channels with less frequent touches, fewer but potentially higher-quality signals, better for strong trending markets
 
 Market-Specific Optimization:  High volatility markets (crypto, small-caps) use 2.5-3.0 multiplier, medium volatility markets (major forex, large-caps) use 2.0 multiplier, low volatility markets (bonds, utilities) use 1.5-2.0 multiplier.
 MA Type Parameter (Middle Band): 
Critical selection that determines trend identification characteristics:
 
 EMA (Exponential Moving Average - Default): Standard Keltner Channel choice, Chester Keltner's original specification, emphasizes recent prices, faster response to trend changes, suitable for all timeframes
 SMA (Simple Moving Average): Equal weighting of all data points, no directional bias, slower than EMA, better for ranging markets and mean-reversion
 HMA (Hull Moving Average): Minimal lag with smooth output, excellent for fast trend identification, best for day trading and scalping
 TEMA (Triple Exponential Moving Average): Advanced smoothing with reduced lag, responsive to trends while filtering noise, suitable for volatile markets
 T3 (Tillson T3): Very smooth with minimal lag, excellent for established trend identification, suitable for position trading
 KAMA (Kaufman Adaptive Moving Average): Automatically adjusts speed based on market efficiency, slow in ranging markets, fast in trends, suitable for markets with varying conditions
 
 ATR MA Type Parameter: 
Determines how Average True Range is smoothed, affecting channel width stability:
 
 RMA (Wilder's Smoothing - Default): J. Welles Wilder's original ATR smoothing method, very smooth, slow to adapt to volatility changes, provides stable channel width
 SMA (Simple Moving Average): Equal weighting, moderate smoothness, faster response to volatility changes than RMA, more dynamic channel width
 EMA (Exponential Moving Average): Emphasizes recent volatility, quick adaptation to new volatility regimes, very responsive channel width changes
 TEMA (Triple Exponential Moving Average): Smooth yet responsive, good balance for varying volatility, suitable for most trading styles
 
 Parameter Combination Strategies: 
 
 Conservative Trend-Following: Length 30/ATR Length 20/Multiplier 2.5, MA Type EMA or TEMA/ATR MA Type RMA, smooth trend with stable wide channels, suitable for position trading
 Standard Balanced Approach: Length 20/ATR Length 10/Multiplier 2.0, MA Type EMA/ATR MA Type RMA, classic Keltner Channel configuration, suitable for general purpose swing trading
 Aggressive Day Trading: Length 10-15/ATR Length 5-7/Multiplier 1.5-2.0, MA Type HMA or EMA/ATR MA Type EMA or SMA, fast trend with dynamic channels, suitable for scalping and day trading
 Breakout Specialist: Length 20-30/ATR Length 5-10/Multiplier 2.0, MA Type SMA or WMA/ATR MA Type EMA or SMA, stable trend with responsive channel width
 Adaptive All-Conditions: Length 20/ATR Length 10/Multiplier 2.0, MA Type KAMA or FRAMA/ATR MA Type KAMA or TEMA, self-adjusting to market conditions
 
 Offset Parameter: 
Controls horizontal positioning of channels on chart. Positive values shift channels to the right (future) for visual projection, negative values shift left (past) for historical analysis, zero (default) aligns with current price bars for real-time signal analysis. Offset affects only visual display, not alert conditions or actual calculations.
 📈 PERFORMANCE ANALYSIS & COMPETITIVE ADVANTAGES 
Keltner Channel Enhanced provides improvements over standard implementations while maintaining proven effectiveness.
 Response Characteristics: 
 
 Standard EMA/RMA Configuration: Moderate trend lag (approximately 0.4 × length periods), smooth and stable channel width from RMA smoothing, good balance for most market conditions
 Fast HMA/EMA Configuration: Approximately 60% reduction in trend lag compared to EMA, responsive channel width from EMA ATR smoothing, suitable for quick trend changes and breakouts
 Adaptive KAMA/KAMA Configuration: Variable lag based on market efficiency, automatic adjustment to trending vs. ranging conditions, self-optimizing behavior reduces manual intervention
 
 Comparison with Traditional Keltner Channels: 
 Enhanced Version Advantages: 
 
 Dual Algorithm Flexibility: Independent MA selection for trend and volatility vs. fixed EMA/RMA, separate tuning of trend responsiveness and channel stability
 Market Adaptation: Choose configurations optimized for specific instruments and conditions, customize for scalping, swing, or position trading preferences
 Comprehensive Alerts: Enhanced alert system including channel expansion detection
 
 Traditional Version Advantages: 
 
 Simplicity: Fewer parameters, easier to understand and implement
 Standardization: Fixed EMA/RMA combination ensures consistency across users
 Research Base: Decades of backtesting and research on standard configuration
 
 When to Use Enhanced Version:  Trading multiple instruments with different characteristics, switching between trending and ranging markets, employing different strategies, algorithm-based trading systems requiring customization, seeking optimization for specific trading style and timeframe.
 When to Use Standard Version:  Beginning traders learning Keltner Channel concepts, following published research or trading systems, preferring simplicity and standardization, wanting to avoid optimization and curve-fitting risks.
 Performance Across Market Conditions: 
 
 Strong Trending Markets: EMA or HMA basis with RMA or TEMA ATR smoothing provides quicker trend identification, pullbacks to basis offer excellent entry opportunities
 Choppy/Ranging Markets: SMA or WMA basis with RMA ATR smoothing and lower multipliers, channel bounce strategies work well, avoid false breakouts
 Volatile Markets: KAMA or FRAMA with EMA or TEMA, adaptive algorithms excel by automatic adjustment, wider multipliers (2.5-3.0) accommodate large price swings
 Low Volatility/Consolidation: Channels narrow significantly indicating consolidation, algorithm choice less impactful, focus on detecting channel width contraction for breakout preparation
 
 Keltner Channel vs. Bollinger Bands - Usage Comparison: 
 Favor Keltner Channels When:  Trend-following is primary strategy, trading volatile instruments with gaps, want ATR-based volatility measurement, prefer fewer higher-quality channel touches, seeking stable channel width during trends.
 Favor Bollinger Bands When:  Mean-reversion is primary strategy, trading instruments with limited gaps, want statistical framework based on standard deviation, need squeeze patterns for breakout identification, prefer more frequent trading opportunities.
 Use Both Together:  Bollinger Band squeeze + Keltner Channel breakout is powerful combination, price outside Bollinger Bands but inside Keltner Channels indicates moderate signal, price outside both indicates very strong signal, Bollinger Bands for entries and Keltner Channels for trend confirmation.
 Limitations and Considerations: 
 General Limitations: 
 
 Lagging Indicator: All moving averages lag price, even with reduced-lag algorithms
 Trend-Dependent: Works best in trending markets, less effective in choppy conditions
 No Direction Prediction: Indicates volatility and deviation, not future direction, requires confirmation
 
 Enhanced Version Specific Considerations: 
 
 Optimization Risk: More parameters increase risk of curve-fitting historical data
 Complexity: Additional choices may overwhelm beginning traders
 Backtesting Challenges: Different algorithms produce different historical results
 
 Mitigation Strategies: 
 
 Use Confirmation: Combine with momentum indicators (RSI, MACD), volume, or price action
 Test Parameter Robustness: Ensure parameters work across range of values, not just optimized ones
 Multi-Timeframe Analysis: Confirm signals across different timeframes
 Proper Risk Management: Use appropriate position sizing and stops
 Start Simple: Begin with standard EMA/RMA before exploring alternatives
 
 Optimal Usage Recommendations: 
 For Maximum Effectiveness: 
 
 Start with standard EMA/RMA configuration to understand classic behavior
 Experiment with alternatives on demo account or paper trading
 Match algorithm combination to market condition and trading style
 Use channel width analysis to identify market phases
 Combine with complementary indicators for confirmation
 Implement strict risk management using ATR-based position sizing
 Focus on high-quality setups rather than trading every signal
 Respect the trend: trade with basis direction for higher probability
 
 Complementary Indicators: 
 
 RSI or Stochastic: Confirm momentum at channel extremes
 MACD: Confirm trend direction and momentum shifts
 Volume: Validate breakouts and trend strength
 ADX: Measure trend strength, avoid Keltner signals in weak trends
 Support/Resistance: Combine with traditional levels for high-probability setups
 Bollinger Bands: Use together for enhanced breakout and volatility analysis
 
 USAGE NOTES 
This indicator is designed for technical analysis and educational purposes. Keltner Channel Enhanced has limitations and should not be used as the sole basis for trading decisions. While the flexible moving average selection for both trend and volatility components provides valuable adaptability across different market conditions, algorithm performance varies with market conditions, and past characteristics do not guarantee future results.
Key considerations:
 
 Always use multiple forms of analysis and confirmation before entering trades
 Backtest any parameter combination thoroughly before live trading
 Be aware that optimization can lead to curve-fitting if not done carefully
 Start with standard EMA/RMA settings and adjust only when specific conditions warrant
 Understand that no moving average algorithm can eliminate lag entirely
 Consider market regime (trending, ranging, volatile) when selecting parameters
 Use ATR-based position sizing and risk management on every trade
 Keltner Channels work best in trending markets, less effective in choppy conditions
 Respect the trend direction indicated by price position relative to basis line
 
The enhanced flexibility of dual algorithm selection provides powerful tools for adaptation but requires responsible use, thorough understanding of how different algorithms behave under various market conditions, and disciplined risk management.
Universal Breakout Strategy [KedArc Quant]Description:
A flexible breakout framework where you can test different logics (Prev Day, Bollinger, Volume, ATR, EMA Trend, RSI Confirm, Candle Confirm, Time Filter) under one system.
Choose your breakout mode, and the strategy will handle entries, exits, and optional risk management (ATR stops, take-profits, daily loss guard, cooldowns). 
An on-chart info table shows live mode values (like Prev High/Low, Bollinger levels, RSI, etc.) plus P&L stats for quick analysis.
Use it to compare which breakout style works best on your instrument and timeframe, whether intraday, swing, or positional trading
 🔑 Why it’s useful
* Flexibility: Switch between breakout strategies without loading different indicators.
* Clarity: On-chart info table displays current mode, relevant indicator levels, and live strategy P&L stats.
* Testing efficiency: Quickly A/B test different breakout styles under the same backtest environment.
* Transparency: Every trade is rule-based and displayed with entry/exit markers.
 🚀 How it helps traders
* Lets you experiment with breakout strategies quickly without loading multiple scripts.
* Helps identify which breakout method fits your instrument & timeframe.
* Gives clear on-chart visual + statistical feedback for confident decision-making.
 ⚙️ Input Configuration
* Breakout Mode → choose which strategy to test:
  * *Prev Day* → breakouts of yesterday’s High/Low.
  * *Bollinger* → Upper/Lower BB pierce.
  * *Volume* → Breakout confirmed with volume above average.
  * *ATR Stop* → Wide range breakout using ATR filter.
  * *Time Filter* → Breakouts inside defined session hours.
  * *EMA Trend* → Breakouts only in EMA fast > slow alignment.
  * *RSI Confirm* → Breakouts with RSI confirmation (e.g. >55 for longs).
  * *Candle Confirm* → Breakouts validated by bullish/bearish candle.
* Lookback / ATR / Bollinger inputs → adjust sensitivity.
* Intrabar mode → option to evaluate breakouts using bar highs/lows instead of closes.
* Table options → show/hide info table, show/hide P&L stats, choose corner placement.
 📈 Entry & Exit Logic
* Entry → occurs when breakout condition of chosen mode is met.
* Exit → default exits via opposite signals or optional stop/target if enabled.
* Session filter → optional auto-flat at session end.
* P&L management → optional daily loss guard, cooldown between trades, and ATR-based stop/take profit.
 ❓ FAQ — Choosing the best setup
Q: Which strategy should I use for which chart?
* *Prev Day Breakouts*: Best on indices, FX, and liquid futures with strong daily levels.
* *Bollinger*: Works well in range-bound environments, or crypto pairs with volatility compression.
* *Volume*: Good on equities where breakout strength is tied to volume spikes.
* *ATR Stop*: Suits volatile instruments (commodities, crypto).
* *EMA Trend*: Useful in trending markets (stocks, indices).
* *RSI Confirm*: Adds momentum filter, better for swing trades.
* *Candle Confirm*: Ideal for scalpers needing visual confirmation.
* *Time Filter*: For intraday traders who want signals only in high-liquidity sessions.
Q: What timeframe should I use?
* Intraday traders → 5m to 15m (Time Filter, Candle Confirm).
* Swing traders → 1H to 4H (EMA Trend, RSI Confirm, ATR Stop).
* Position traders → Daily (Prev Day, Bollinger).
* Breakout
	A trade entry condition triggered when price crosses above a resistance level (for longs) or below a support level (for shorts).
* Prev Day High/Low
	Formula:
	Prev High = High of (Day )
	Prev Low = Low of (Day )
* Bollinger Bands
	Formula:
	Basis = SMA(Close, Length)
	Upper Band = Basis + (Multiplier × StdDev(Close, Length))
	Lower Band = Basis – (Multiplier × StdDev(Close, Length))
* Volume Confirmation
	A breakout is only valid if:
	Volume > SMA(Volume, Length)
* ATR (Average True Range)
	Measures volatility.
	
	Formula:
	ATR = SMA(True Range, Length)
	where True Range = max(High–Low, |High–Close |, |Low–Close |)
* EMA (Exponential Moving Average)
	Weighted moving average giving more weight to recent prices.
	Formula:
	EMA = (Price × α) + (EMA  × (1–α))
	with α = 2 / (Length + 1)
* RSI (Relative Strength Index)
	
	Momentum oscillator scaled 0–100.
	
	Formula:
	RSI = 100 – (100 / (1 + RS))
	where RS = Avg(Gain, Length) ÷ Avg(Loss, Length)
* Candle Confirmation
	
	Bullish candle: Close > Open AND Close > Close 
	Bearish candle: Close < Open AND Close < Close 
	Win Rate (%)
	Formula:
	Win Rate = (Winning Trades ÷ Total Trades) × 100
* Average Trade P&L
	Formula:
	Avg Trade = Net Profit ÷ Total Trades
📊 Performance Notes
	The Universal Breakout Strategy is designed as a framework rather than a single-asset optimized system. Results will vary depending on the chart, timeframe, and asset chosen.
	On the current defaults (15-minute, INR-denominated example), the backtest produced 132 trades over the selected period. This provides a statistically sufficient sample size.
	Win rate (~35%) is relatively low, but this is balanced by a positive reward-to-risk ratio (~1.8). In practice, a lower win rate with larger wins versus smaller losses is sustainable.
	The average P&L per trade is close to breakeven under default settings. This is expected, as the strategy is not tuned for a single symbol but offered as a universal breakout framework.
	Commissions (0.1%) and slippage (1 tick) are included in the simulation, ensuring realistic conditions.
	Risk management is conservative, with order sizing set at 1 unit per trade. This avoids over-leveraging and keeps exposure well under the 5-10% equity risk guideline.
👉 Traders are encouraged to:
	Experiment with inputs such as ATR period, breakout length, or Bollinger parameters.
	Test across different timeframes and instruments (equities, futures, forex, crypto) to find optimal setups.
	Combine with filters (trend direction, volatility regimes, or volume conditions) for further refinement.
⚠️ Disclaimer This script is provided for educational purposes only.
Past performance does not guarantee future results.
Trading involves risk, and users should exercise caution and use proper risk management when applying this strategy.






















